var Prototype={Version:"1.4.0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_2,_3){
for(property in _3){
_2[property]=_3[property];
}
return _2;
};
Object.inspect=function(_4){
try{
if(_4==undefined){
return "undefined";
}
if(_4==null){
return "null";
}
return _4.inspect?_4.inspect():_4.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
};
Function.prototype.bind=function(){
var _5=this,args=$A(arguments),object=args.shift();
return function(){
return _5.apply(object,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_6){
var _7=this;
return function(_8){
return _7.call(_6,_8||window.event);
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _9=this.toString(16);
if(this<16){
return "0"+_9;
}
return _9;
},succ:function(){
return this+1;
},times:function(_a){
$R(0,this,true).each(_a);
return this;
}});
var Try={these:function(){
var _b;
for(var i=0;i<arguments.length;i++){
var _d=arguments[i];
try{
_b=_d();
break;
}
catch(e){
}
}
return _b;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_e,_f){
this.callback=_e;
this.frequency=_f;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback();
}
finally{
this.currentlyExecuting=false;
}
}
}};
function $(){
var _10=new Array();
for(var i=0;i<arguments.length;i++){
var _12=arguments[i];
if(typeof _12=="string"){
_12=document.getElementById(_12);
}
if(arguments.length==1){
return _12;
}
_10.push(_12);
}
return _10;
}
Object.extend(String.prototype,{stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _13=new RegExp(Prototype.ScriptFragment,"img");
var _14=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_13)||[]).map(function(_15){
return (_15.match(_14)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(eval);
},escapeHTML:function(){
var div=document.createElement("div");
var _17=document.createTextNode(this);
div.appendChild(_17);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?div.childNodes[0].nodeValue:"";
},getHtmlText:function(){
var _19=this;
_19=_19.replace(/&/gi,"&amp;");
_19=_19.replace(/</gi,"&lt;");
_19=_19.replace(/>/gi,"&gt;");
_19=_19.replace(/\"/gi,"&quot;");
return _19.replace(/(\r\n)/g,"<br>").replace(/(\r|\n)/g,"<br>");
},toQueryParams:function(){
var _1a=this.match(/^\??(.*)$/)[1].split("&");
return _1a.inject({},function(_1b,_1c){
var _1d=_1c.split("=");
_1b[_1d[0]]=_1d[1];
return _1b;
});
},toArray:function(){
return this.split("");
},camelize:function(){
var _1e=this.split("-");
if(_1e.length==1){
return _1e[0];
}
var _1f=this.indexOf("-")==0?_1e[0].charAt(0).toUpperCase()+_1e[0].substring(1):_1e[0];
for(var i=1,len=_1e.length;i<len;i++){
var s=_1e[i];
_1f+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _1f;
},inspect:function(){
return "'"+this.replace("\\","\\\\").replace("'","\\'")+"'";
}});
String.prototype.parseQuery=String.prototype.toQueryParams;
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_22){
var _23=0;
try{
this._each(function(_24){
try{
_22(_24,_23++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
},all:function(_25){
var _26=true;
this.each(function(_27,_28){
_26=_26&&!!(_25||Prototype.K)(_27,_28);
if(!_26){
throw $break;
}
});
return _26;
},any:function(_29){
var _2a=true;
this.each(function(_2b,_2c){
if(_2a=!!(_29||Prototype.K)(_2b,_2c)){
throw $break;
}
});
return _2a;
},collect:function(_2d){
var _2e=[];
this.each(function(_2f,_30){
_2e.push(_2d(_2f,_30));
});
return _2e;
},detect:function(_31){
var _32;
this.each(function(_33,_34){
if(_31(_33,_34)){
_32=_33;
throw $break;
}
});
return _32;
},findAll:function(_35){
var _36=[];
this.each(function(_37,_38){
if(_35(_37,_38)){
_36.push(_37);
}
});
return _36;
},grep:function(_39,_3a){
var _3b=[];
this.each(function(_3c,_3d){
var _3e=_3c.toString();
if(_3e.match(_39)){
_3b.push((_3a||Prototype.K)(_3c,_3d));
}
});
return _3b;
},include:function(_3f){
var _40=false;
this.each(function(_41){
if(_41==_3f){
_40=true;
throw $break;
}
});
return _40;
},inject:function(_42,_43){
this.each(function(_44,_45){
_42=_43(_42,_44,_45);
});
return _42;
},invoke:function(_46){
var _47=$A(arguments).slice(1);
return this.collect(function(_48){
return _48[_46].apply(_48,_47);
});
},max:function(_49){
var _4a;
this.each(function(_4b,_4c){
_4b=(_49||Prototype.K)(_4b,_4c);
if(_4b>=(_4a||_4b)){
_4a=_4b;
}
});
return _4a;
},min:function(_4d){
var _4e;
this.each(function(_4f,_50){
_4f=(_4d||Prototype.K)(_4f,_50);
if(_4f<=(_4e||_4f)){
_4e=_4f;
}
});
return _4e;
},partition:function(_51){
var _52=[],falses=[];
this.each(function(_53,_54){
((_51||Prototype.K)(_53,_54)?_52:falses).push(_53);
});
return [_52,falses];
},pluck:function(_55){
var _56=[];
this.each(function(_57,_58){
_56.push(_57[_55]);
});
return _56;
},reject:function(_59){
var _5a=[];
this.each(function(_5b,_5c){
if(!_59(_5b,_5c)){
_5a.push(_5b);
}
});
return _5a;
},sortBy:function(_5d){
return this.collect(function(_5e,_5f){
return {value:_5e,criteria:_5d(_5e,_5f)};
}).sort(function(_60,_61){
var a=_60.criteria,b=_61.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.collect(Prototype.K);
},zip:function(){
var _63=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_63=args.pop();
}
var _64=[this].concat(args).map($A);
return this.map(function(_65,_66){
_63(_65=_64.pluck(_66));
return _65;
});
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_67){
if(!_67){
return [];
}
if(_67.toArray){
return _67.toArray();
}else{
var _68=[];
for(var i=0;i<_67.length;i++){
_68.push(_67[i]);
}
return _68;
}
};
Object.extend(Array.prototype,Enumerable);
Array.prototype._reverse=Array.prototype.reverse;
Object.extend(Array.prototype,{_each:function(_6a){
for(var i=0;i<this.length;i++){
_6a(this[i]);
}
},clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_6c){
return _6c!=undefined||_6c!=null;
});
},flatten:function(){
return this.inject([],function(_6d,_6e){
return _6d.concat(_6e.constructor==Array?_6e.flatten():[_6e]);
});
},without:function(){
var _6f=$A(arguments);
return this.select(function(_70){
return !_6f.include(_70);
});
},indexOf:function(_71){
for(var i=0;i<this.length;i++){
if(this[i]==_71){
return i;
}
}
return -1;
},reverse:function(_73){
return (_73!==false?this:this.toArray())._reverse();
},shift:function(){
var _74=this[0];
for(var i=0;i<this.length-1;i++){
this[i]=this[i+1];
}
this.length--;
return _74;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
var Hash={_each:function(_76){
for(key in this){
var _77=this[key];
if(typeof _77=="function"){
continue;
}
var _78=[key,_77];
_78.key=key;
_78.value=_77;
_76(_78);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_79){
return $H(_79).inject($H(this),function(_7a,_7b){
_7a[_7b.key]=_7b.value;
return _7a;
});
},toQueryString:function(){
return this.map(function(_7c){
return _7c.map(encodeURIComponent).join("=");
}).join("&");
},inspect:function(){
return "#<Hash:{"+this.map(function(_7d){
return _7d.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}};
function $H(_7e){
var _7f=Object.extend({},_7e||{});
Object.extend(_7f,Enumerable);
Object.extend(_7f,Hash);
return _7f;
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_80,end,_82){
this.start=_80;
this.end=end;
this.exclusive=_82;
},_each:function(_83){
var _84=this.start;
do{
_83(_84);
_84=_84.succ();
}while(this.include(_84));
},include:function(_85){
if(_85<this.start){
return false;
}
if(this.exclusive){
return _85<this.end;
}
return _85<=this.end;
}});
var $R=function(_86,end,_88){
return new ObjectRange(_86,end,_88);
};
var Ajax={getTransport:function(){
return Try.these(function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
},function(){
return new XMLHttpRequest();
})||false;
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(_89){
this.responders._each(_89);
},register:function(_8a){
if(!this.include(_8a)){
this.responders.push(_8a);
}
},unregister:function(_8b){
this.responders=this.responders.without(_8b);
},dispatch:function(_8c,_8d,_8e,_8f){
this.each(function(_90){
if(_90[_8c]&&typeof _90[_8c]=="function"){
try{
_90[_8c].apply(_90,[_8d,_8e,_8f]);
}
catch(e){
}
}
});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){
Ajax.activeRequestCount++;
},onComplete:function(){
Ajax.activeRequestCount--;
}});
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_91){
this.options={method:"post",asynchronous:true,parameters:""};
Object.extend(this.options,_91||{});
},responseIsSuccess:function(){
return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);
},responseIsFailure:function(){
return !this.responseIsSuccess();
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,_93){
this.transport=Ajax.getTransport();
this.setOptions(_93);
this.request(url);
},request:function(url){
var _95=this.options.parameters||"";
if(_95.length>0){
_95+="&_=";
}
try{
this.url=url;
if(this.options.method=="get"&&_95.length>0){
this.url+=(this.url.match(/\?/)?"&":"?")+_95;
}
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.options.method,this.url,this.options.asynchronous);
if(this.options.asynchronous){
this.transport.onreadystatechange=this.onStateChange.bind(this);
setTimeout((function(){
this.respondToReadyState(1);
}).bind(this),10);
}
this.setRequestHeaders();
var _96=this.options.postBody?this.options.postBody:_95;
this.transport.send(this.options.method=="post"?_96:null);
}
catch(e){
this.dispatchException(e);
}
},setRequestHeaders:function(){
var _97=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version];
if(this.options.method=="post"){
_97.push("Content-type","application/x-www-form-urlencoded");
if(this.transport.overrideMimeType){
_97.push("Connection","close");
}
}
if(this.options.requestHeaders){
_97.push.apply(_97,this.options.requestHeaders);
}
for(var i=0;i<_97.length;i+=2){
this.transport.setRequestHeader(_97[i],_97[i+1]);
}
},onStateChange:function(){
var _99=this.transport.readyState;
if(_99!=1){
this.respondToReadyState(this.transport.readyState);
}
},header:function(_9a){
try{
return this.transport.getResponseHeader(_9a);
}
catch(e){
}
},evalJSON:function(){
try{
return eval(this.header("X-JSON"));
}
catch(e){
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},respondToReadyState:function(_9b){
var _9c=Ajax.Request.Events[_9b];
var _9d=this.transport,json=this.evalJSON();
if(_9c=="Complete"){
try{
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_9d,json);
}
catch(e){
this.dispatchException(e);
}
if((this.header("Content-type")||"").match(/^text\/javascript/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_9c]||Prototype.emptyFunction)(_9d,json);
Ajax.Responders.dispatch("on"+_9c,this,_9d,json);
}
catch(e){
this.dispatchException(e);
}
if(_9c=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},dispatchException:function(_9e){
(this.options.onException||Prototype.emptyFunction)(this,_9e);
Ajax.Responders.dispatch("onException",this,_9e);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_9f,url,_a1){
this.containers={success:_9f.success?$(_9f.success):$(_9f),failure:_9f.failure?$(_9f.failure):(_9f.success?null:$(_9f))};
this.transport=Ajax.getTransport();
this.setOptions(_a1);
var _a2=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_a3,_a4){
this.updateContent();
_a2(_a3,_a4);
}).bind(this);
this.request(url);
},updateContent:function(){
var _a5=this.responseIsSuccess()?this.containers.success:this.containers.failure;
var _a6=this.transport.responseText;
if(!this.options.evalScripts){
_a6=_a6.stripScripts();
}
if(_a5){
if(this.options.insertion){
new this.options.insertion(_a5,_a6);
}else{
Element.update(_a5,_a6);
}
}
if(this.responseIsSuccess()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_a7,url,_a9){
this.setOptions(_a9);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_a7;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
},updateComplete:function(_aa){
if(this.options.decay){
this.decay=(_aa.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_aa.responseText;
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);
},onTimerEvent:function(){
this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
document.getElementsByClassName=function(_ab,_ac){
var _ad=($(_ac)||document.body).getElementsByTagName("*");
return $A(_ad).inject([],function(_ae,_af){
if(_af.className.match(new RegExp("(^|\\s)"+_ab+"(\\s|$)"))){
_ae.push(_af);
}
return _ae;
});
};
if(!window.Element){
var Element=new Object();
}
Object.extend(Element,{visible:function(_b0){
return $(_b0).style.display!="none";
},toggle:function(){
for(var i=0;i<arguments.length;i++){
var _b2=$(arguments[i]);
Element[Element.visible(_b2)?"hide":"show"](_b2);
}
},hide:function(){
for(var i=0;i<arguments.length;i++){
var _b4=$(arguments[i]);
_b4.style.display="none";
}
},show:function(){
for(var i=0;i<arguments.length;i++){
var _b6=$(arguments[i]);
_b6.style.display="";
}
},remove:function(_b7){
_b7=$(_b7);
_b7.parentNode.removeChild(_b7);
},update:function(_b8,_b9){
$(_b8).innerHTML=_b9.stripScripts();
setTimeout(function(){
_b9.evalScripts();
},10);
},getHeight:function(_ba){
_ba=$(_ba);
return _ba.offsetHeight;
},classNames:function(_bb){
return new Element.ClassNames(_bb);
},hasClassName:function(_bc,_bd){
if(!(_bc=$(_bc))){
return;
}
return Element.classNames(_bc).include(_bd);
},addClassName:function(_be,_bf){
if(!(_be=$(_be))){
return;
}
return Element.classNames(_be).add(_bf);
},removeClassName:function(_c0,_c1){
if(!(_c0=$(_c0))){
return;
}
return Element.classNames(_c0).remove(_c1);
},cleanWhitespace:function(_c2){
_c2=$(_c2);
for(var i=0;i<_c2.childNodes.length;i++){
var _c4=_c2.childNodes[i];
if(_c4.nodeType==3&&!/\S/.test(_c4.nodeValue)){
Element.remove(_c4);
}
}
},empty:function(_c5){
return $(_c5).innerHTML.match(/^\s*$/);
},scrollTo:function(_c6){
_c6=$(_c6);
var x=_c6.x?_c6.x:_c6.offsetLeft,y=_c6.y?_c6.y:_c6.offsetTop;
window.scrollTo(x,y);
},getStyle:function(_c8,_c9){
_c8=$(_c8);
var _ca=_c8.style[_c9.camelize()];
if(!_ca){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_c8,null);
_ca=css?css.getPropertyValue(_c9):null;
}else{
if(_c8.currentStyle){
_ca=_c8.currentStyle[_c9.camelize()];
}
}
}
if(window.opera&&["left","top","right","bottom"].include(_c9)){
if(Element.getStyle(_c8,"position")=="static"){
_ca="auto";
}
}
return _ca=="auto"?null:_ca;
},setStyle:function(_cc,_cd){
_cc=$(_cc);
for(name in _cd){
_cc.style[name.camelize()]=_cd[name];
}
},getDimensions:function(_ce){
_ce=$(_ce);
if(Element.getStyle(_ce,"display")!="none"){
return {width:_ce.offsetWidth,height:_ce.offsetHeight};
}
var els=_ce.style;
var _d0=els.visibility;
var _d1=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _d2=_ce.clientWidth;
var _d3=_ce.clientHeight;
els.display="none";
els.position=_d1;
els.visibility=_d0;
return {width:_d2,height:_d3};
},makePositioned:function(_d4){
_d4=$(_d4);
var pos=Element.getStyle(_d4,"position");
if(pos=="static"||!pos){
_d4._madePositioned=true;
_d4.style.position="relative";
if(window.opera){
_d4.style.top=0;
_d4.style.left=0;
}
}
},undoPositioned:function(_d6){
_d6=$(_d6);
if(_d6._madePositioned){
_d6._madePositioned=undefined;
_d6.style.position=_d6.style.top=_d6.style.left=_d6.style.bottom=_d6.style.right="";
}
},makeClipping:function(_d7){
_d7=$(_d7);
if(_d7._overflow){
return;
}
_d7._overflow=_d7.style.overflow;
if((Element.getStyle(_d7,"overflow")||"visible")!="hidden"){
_d7.style.overflow="hidden";
}
},undoClipping:function(_d8){
_d8=$(_d8);
if(_d8._overflow){
return;
}
_d8.style.overflow=_d8._overflow;
_d8._overflow=undefined;
}});
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_d9){
this.adjacency=_d9;
};
Abstract.Insertion.prototype={initialize:function(_da,_db){
this.element=$(_da);
this.content=_db.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
if(this.element.tagName.toLowerCase()=="tbody"){
this.insertContent(this.contentFromAnonymousTable());
}else{
throw e;
}
}
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.insertContent([this.range.createContextualFragment(this.content)]);
}
setTimeout(function(){
_db.evalScripts();
},10);
},contentFromAnonymousTable:function(){
var div=document.createElement("div");
div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";
return $A(div.childNodes[0].childNodes[0].childNodes);
}};
var Insertion=new Object();
Insertion.Before=Class.create();
Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){
this.range.setStartBefore(this.element);
},insertContent:function(_dd){
_dd.each((function(_de){
this.element.parentNode.insertBefore(_de,this.element);
}).bind(this));
}});
Insertion.Top=Class.create();
Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},insertContent:function(_df){
_df.reverse(false).each((function(_e0){
this.element.insertBefore(_e0,this.element.firstChild);
}).bind(this));
}});
Insertion.Bottom=Class.create();
Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},insertContent:function(_e1){
_e1.each((function(_e2){
this.element.appendChild(_e2);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_e3){
_e3.each((function(_e4){
this.element.parentNode.insertBefore(_e4,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_e5){
this.element=$(_e5);
},_each:function(_e6){
this.element.className.split(/\s+/).select(function(_e7){
return _e7.length>0;
})._each(_e6);
},set:function(_e8){
this.element.className=_e8;
},add:function(_e9){
if(this.include(_e9)){
return;
}
this.set(this.toArray().concat(_e9).join(" "));
},remove:function(_ea){
if(!this.include(_ea)){
return;
}
this.set(this.select(function(_eb){
return _eb!=_ea;
}).join(" "));
},toString:function(){
return this.toArray().join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Field={clear:function(){
for(var i=0;i<arguments.length;i++){
$(arguments[i]).value="";
}
},focus:function(_ed){
$(_ed).focus();
},present:function(){
for(var i=0;i<arguments.length;i++){
if($(arguments[i]).value==""){
return false;
}
}
return true;
},select:function(_ef){
$(_ef).select();
},activate:function(_f0){
_f0=$(_f0);
_f0.focus();
if(_f0.select){
_f0.select();
}
}};
var Form={serialize:function(_f1){
var _f2=Form.getElements($(_f1));
var _f3=new Array();
for(var i=0;i<_f2.length;i++){
var _f5=Form.Element.serialize(_f2[i]);
if(_f5){
_f3.push(_f5);
}
}
return _f3.join("&");
},getElements:function(_f6){
_f6=$(_f6);
var _f7=new Array();
for(tagName in Form.Element.Serializers){
var _f8=_f6.getElementsByTagName(tagName);
for(var j=0;j<_f8.length;j++){
_f7.push(_f8[j]);
}
}
return _f7;
},getInputs:function(_fa,_fb,_fc){
_fa=$(_fa);
var _fd=_fa.getElementsByTagName("input");
if(!_fb&&!_fc){
return _fd;
}
var _fe=new Array();
for(var i=0;i<_fd.length;i++){
var _100=_fd[i];
if((_fb&&_100.type!=_fb)||(_fc&&_100.name!=_fc)){
continue;
}
_fe.push(_100);
}
return _fe;
},disable:function(form){
var _102=Form.getElements(form);
for(var i=0;i<_102.length;i++){
var _104=_102[i];
_104.blur();
_104.disabled="true";
}
},enable:function(form){
var _106=Form.getElements(form);
for(var i=0;i<_106.length;i++){
var _108=_106[i];
_108.disabled="";
}
},findFirstElement:function(form){
return Form.getElements(form).find(function(_10a){
return _10a.type!="hidden"&&!_10a.disabled&&["input","select","textarea"].include(_10a.tagName.toLowerCase());
});
},focusFirstElement:function(form){
Field.activate(Form.findFirstElement(form));
},reset:function(form){
$(form).reset();
}};
Form.Element={serialize:function(_10d){
_10d=$(_10d);
var _10e=_10d.tagName.toLowerCase();
var _10f=Form.Element.Serializers[_10e](_10d);
if(_10f){
var key=encodeURIComponent(_10f[0]);
if(key.length==0){
return;
}
if(_10f[1].constructor!=Array){
_10f[1]=[_10f[1]];
}
return _10f[1].map(function(_111){
return key+"="+encodeURIComponent(_111);
}).join("&");
}
},getValue:function(_112){
_112=$(_112);
var _113=_112.tagName.toLowerCase();
var _114=Form.Element.Serializers[_113](_112);
if(_114){
return _114[1];
}
}};
Form.Element.Serializers={input:function(_115){
switch(_115.type.toLowerCase()){
case "submit":
case "hidden":
case "password":
case "text":
return Form.Element.Serializers.textarea(_115);
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_115);
}
return false;
},inputSelector:function(_116){
if(_116.checked){
return [_116.name,_116.value];
}
},textarea:function(_117){
return [_117.name,_117.value];
},select:function(_118){
return Form.Element.Serializers[_118.type=="select-one"?"selectOne":"selectMany"](_118);
},selectOne:function(_119){
var _11a="",opt,index=_119.selectedIndex;
if(index>=0){
opt=_119.options[index];
_11a=opt.value;
if(!_11a&&!("value" in opt)){
_11a=opt.text;
}
}
return [_119.name,_11a];
},selectMany:function(_11b){
var _11c=new Array();
for(var i=0;i<_11b.length;i++){
var opt=_11b.options[i];
if(opt.selected){
var _11f=opt.value;
if(!_11f&&!("value" in opt)){
_11f=opt.text;
}
_11c.push(_11f);
}
}
return [_11b.name,_11c];
}};
var $F=Form.Element.getValue;
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_120,_121,_122){
this.frequency=_121;
this.element=$(_120);
this.callback=_122;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _123=this.getValue();
if(this.lastValue!=_123){
this.callback(this.element,_123);
this.lastValue=_123;
}
}};
Form.Element.Observer=Class.create();
Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create();
Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
Abstract.EventObserver=function(){
};
Abstract.EventObserver.prototype={initialize:function(_124,_125){
this.element=$(_124);
this.callback=_125;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _126=this.getValue();
if(this.lastValue!=_126){
this.callback(this.element,_126);
this.lastValue=_126;
}
},registerFormCallbacks:function(){
var _127=Form.getElements(this.element);
for(var i=0;i<_127.length;i++){
this.registerCallback(_127[i]);
}
},registerCallback:function(_129){
if(_129.type){
switch(_129.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_129,"click",this.onElementEvent.bind(this));
break;
case "password":
case "text":
case "textarea":
case "select-one":
case "select-multiple":
Event.observe(_129,"change",this.onElementEvent.bind(this));
break;
}
}
}};
Form.Element.EventObserver=Class.create();
Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create();
Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_12a){
return _12a.target||_12a.srcElement;
},isLeftClick:function(_12b){
return (((_12b.which)&&(_12b.which==1))||((_12b.button)&&(_12b.button==1)));
},pointerX:function(_12c){
return _12c.pageX||(_12c.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_12d){
return _12d.pageY||(_12d.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_12e){
if(_12e.preventDefault){
_12e.preventDefault();
_12e.stopPropagation();
}else{
_12e.returnValue=false;
_12e.cancelBubble=true;
}
},findElement:function(_12f,_130){
var _131=Event.element(_12f);
while(_131.parentNode&&(!_131.tagName||(_131.tagName.toUpperCase()!=_130.toUpperCase()))){
_131=_131.parentNode;
}
return _131;
},observers:false,_observeAndCache:function(_132,name,_134,_135){
if(!this.observers){
this.observers=[];
}
if(_132.addEventListener){
this.observers.push([_132,name,_134,_135]);
_132.addEventListener(name,_134,_135);
}else{
if(_132.attachEvent){
this.observers.push([_132,name,_134,_135]);
_132.attachEvent("on"+name,_134);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0;i<Event.observers.length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_137,name,_139,_13a){
var _137=$(_137);
_13a=_13a||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_137.attachEvent)){
name="keydown";
}
this._observeAndCache(_137,name,_139,_13a);
},stopObserving:function(_13b,name,_13d,_13e){
var _13b=$(_13b);
_13e=_13e||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_13b.detachEvent)){
name="keydown";
}
if(_13b.removeEventListener){
_13b.removeEventListener(name,_13d,_13e);
}else{
if(_13b.detachEvent){
_13b.detachEvent("on"+name,_13d);
}
}
}});
Event.observe(window,"unload",Event.unloadCache,false);
var Position={includeScrollOffsets:false,prepare:function(){
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
},realOffset:function(_13f){
var _140=0,valueL=0;
do{
_140+=_13f.scrollTop||0;
valueL+=_13f.scrollLeft||0;
_13f=_13f.parentNode;
}while(_13f);
return [valueL,_140];
},cumulativeOffset:function(_141){
var _142=0,valueL=0;
do{
_142+=_141.offsetTop||0;
valueL+=_141.offsetLeft||0;
_141=_141.offsetParent;
}while(_141);
return [valueL,_142];
},positionedOffset:function(_143){
var _144=0,valueL=0;
do{
_144+=_143.offsetTop||0;
valueL+=_143.offsetLeft||0;
_143=_143.offsetParent;
if(_143){
p=Element.getStyle(_143,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_143);
return [valueL,_144];
},offsetParent:function(_145){
if(_145.offsetParent){
return _145.offsetParent;
}
if(_145==document.body){
return _145;
}
while((_145=_145.parentNode)&&_145!=document.body){
if(Element.getStyle(_145,"position")!="static"){
return _145;
}
}
return document.body;
},within:function(_146,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_146,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_146);
return (y>=this.offset[1]&&y<this.offset[1]+_146.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_146.offsetWidth);
},withinIncludingScrolloffsets:function(_149,x,y){
var _14c=this.realOffset(_149);
this.xcomp=x+_14c[0]-this.deltaX;
this.ycomp=y+_14c[1]-this.deltaY;
this.offset=this.cumulativeOffset(_149);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_149.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_149.offsetWidth);
},overlap:function(mode,_14e){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_14e.offsetHeight)-this.ycomp)/_14e.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_14e.offsetWidth)-this.xcomp)/_14e.offsetWidth;
}
},clone:function(_14f,_150){
_14f=$(_14f);
_150=$(_150);
_150.style.position="absolute";
var _151=this.cumulativeOffset(_14f);
_150.style.top=_151[1]+"px";
_150.style.left=_151[0]+"px";
_150.style.width=_14f.offsetWidth+"px";
_150.style.height=_14f.offsetHeight+"px";
},page:function(_152){
var _153=0,valueL=0;
var _154=_152;
do{
_153+=_154.offsetTop||0;
valueL+=_154.offsetLeft||0;
if(_154.offsetParent==document.body){
if(Element.getStyle(_154,"position")=="absolute"){
break;
}
}
}while(_154=_154.offsetParent);
_154=_152;
do{
_153-=_154.scrollTop||0;
valueL-=_154.scrollLeft||0;
}while(_154=_154.parentNode);
return [valueL,_153];
},clone:function(_155,_156){
var _157=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_155=$(_155);
var p=Position.page(_155);
_156=$(_156);
var _159=[0,0];
var _15a=null;
if(Element.getStyle(_156,"position")=="absolute"){
_15a=Position.offsetParent(_156);
_159=Position.page(_15a);
}
if(_15a==document.body){
_159[0]-=document.body.offsetLeft;
_159[1]-=document.body.offsetTop;
}
if(_157.setLeft){
_156.style.left=(p[0]-_159[0]+_157.offsetLeft)+"px";
}
if(_157.setTop){
_156.style.top=(p[1]-_159[1]+_157.offsetTop)+"px";
}
if(_157.setWidth){
_156.style.width=_155.offsetWidth+"px";
}
if(_157.setHeight){
_156.style.height=_155.offsetHeight+"px";
}
},absolutize:function(_15b){
_15b=$(_15b);
if(_15b.style.position=="absolute"){
return;
}
Position.prepare();
var _15c=Position.positionedOffset(_15b);
var top=_15c[1];
var left=_15c[0];
var _15f=_15b.clientWidth;
var _160=_15b.clientHeight;
_15b._originalLeft=left-parseFloat(_15b.style.left||0);
_15b._originalTop=top-parseFloat(_15b.style.top||0);
_15b._originalWidth=_15b.style.width;
_15b._originalHeight=_15b.style.height;
_15b.style.position="absolute";
_15b.style.top=top+"px";
_15b.style.left=left+"px";
_15b.style.width=_15f+"px";
_15b.style.height=_160+"px";
},relativize:function(_161){
_161=$(_161);
if(_161.style.position=="relative"){
return;
}
Position.prepare();
_161.style.position="relative";
var top=parseFloat(_161.style.top||0)-(_161._originalTop||0);
var left=parseFloat(_161.style.left||0)-(_161._originalLeft||0);
_161.style.top=top+"px";
_161.style.left=left+"px";
_161.style.height=_161._originalHeight;
_161.style.width=_161._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_164){
var _165=0,valueL=0;
do{
_165+=_164.offsetTop||0;
valueL+=_164.offsetLeft||0;
if(_164.offsetParent==document.body){
if(Element.getStyle(_164,"position")=="absolute"){
break;
}
}
_164=_164.offsetParent;
}while(_164);
return [valueL,_165];
};
}

function $$A(_1){
if(_1==null){
return [];
}else{
if(typeof _1!="object"){
return [_1];
}else{
if(_1.toArray==null&&_1.length==null){
return [_1];
}else{
return $A(_1);
}
}
}
}
Object.extend(String.prototype,{startsWith:function(_2){
return (this.substring(0,_2.length)==_2);
},endsWith:function(_3){
return (this.substring(this.length-_3.length)==_3);
},getSuffix:function(_4){
if(!_4){
_4=".";
}
var i=this.lastIndexOf(_4);
return (i!=-1)?this.substring(i+1):"";
}});
String.format=function(_6){
var _7="";
function parse(){
var _8=/%(\d+\$)?([-#+ 0,(<]*)?(\d+)?(\.\d+)?([tT])?([a-zA-Z%])/;
var s=_6||"";
var _a=[];
var sa;
while(sa=_8.exec(s)){
if(sa.index>0){
_a.push(new FormatString(s.substring(0,sa.index)));
}
_a.push(new FormatString(sa));
s=s.substring(sa.index+sa[0].length);
}
if(s){
_a.push(new FormatString(s));
}
return _a;
}
function FormatString(sa){
this.index=0;
var _d;
if(typeof sa=="string"){
this.index=-2;
_d=sa;
}else{
if(sa[1]){
this.index=parseInt(sa[1].substring(0,sa[1].length-1));
}else{
if((sa[2]||"").indexOf("<")!=-1){
this.index=-1;
}else{
if(sa[6]=="%"){
this.index=-2;
_d="%";
}
}
}
}
this.print=function(_e){
if(_d){
_7+=_d;
}else{
if(_e!=null){
_7+=_e;
}
}
};
}
var _f=$A(arguments);
var _10=0;
var _11=-1;
parse().each(function(fs){
switch(fs.index){
case -2:
fs.print(null);
break;
case 0:
_11=++_10;
fs.print(_f[_11]);
break;
case -1:
fs.print(_f[_11]);
break;
default:
_11=fs.index;
fs.print(_f[_11]);
break;
}
});
return _7;
};
if(!window.encodeURIComponent){
(function(){
var _13=function(s,get){
var enc="";
for(var i=0;i<s.length;i++){
var c=s.charCodeAt(i);
if(c>=56320&&c<57344){
continue;
}
if(c>=55296&&c<56320){
if(i>=s.length){
continue;
}
var c1=s.charCodeAt(i++);
if(c1<56320||c>=56832){
continue;
}
c=((c-55296)<<10)+(c1-56320)+65536;
}
if(c<128){
enc+=get(c);
}else{
if(c<2048){
enc+=get(192+(c>>6),128+(c&63));
}else{
if(c<65536){
enc+=get(224+(c>>12),128+(c>>6&63),128+(c&63));
}else{
enc+=get(240+(c>>18),128+(c>>12&63),128+(c>>6&63),128+(c&63));
}
}
}
}
return enc;
};
window.encodeURIComponent=function(s){
return _13(s,function(_1b){
var c=String.fromCharCode(_1b);
if(_1b<16){
return "%0"+_1b.toString(16);
}else{
if((c>="0"&&c<="9")||c=="_"||c=="-"||(c>="A"&&c<="Z")||(c>="a"&&c<="z")){
return c;
}else{
return "%"+_1b.toString(16);
}
}
});
};
})();
}
if(!Array.prototype.add){
Array.prototype.add=function(_1d){
this[this.length]=_1d;
};
}
if(!Array.prototype.splice){
Array.prototype.splice=function(_1e,_1f){
if(!_1f){
return;
}
var _20=arguments.length-2;
var _21=this.length-_1f+_20;
if(_20<_1f){
for(var i=_1e;i<_21;i++){
this[i+_20]=this[i+_1f];
}
}else{
if(_20>_1f){
for(var i=_21-1;i>=_1e;i--){
this[i+_20]=this[i+_1f];
}
}
}
for(var i=0;i<_20;i++){
this[i+_1e]=arguments[i+2];
}
this.length=_21;
};
}
if(!Array.prototype.push){
Array.prototype.push=function(){
var _23=this.length;
for(var i=0;i<arguments.length;i++){
this[_23+i]=arguments[i];
}
return this.length;
};
}
if(!Array.prototype.pop){
Array.prototype.pop=function(){
lastElement=this[this.length-1];
this.length=Math.max(this.length-1,0);
return lastElement;
};
}
if(!Array.prototype.remove){
Array.prototype.remove=function(_25){
for(var i=0;i<this.length;i++){
if(this[i]==_25){
this.splice(i,1);
return true;
}
}
return false;
};
}
Number.getPercent=function(a,b){
var _29=(b!=null)?Number.getRatio(a,b):(a);
return Math.round(_29*100)+"%";
};
Number.getRatio=function(a,b){
return ((a>=b)?1:((a>0)?(a/b):0));
};
Element.children=function(_2c){
_2c=$(_2c);
return (_2c.children)||$A(_2c.childNodes).select(function(_2d){
return _2d.tagName>"";
});
};

var UI={};
(function(){
UI.showWaiting=showWaiting;
UI.confirm=_confirm;
UI.hideWaiting=hideWaiting;
UI.alert=_alert;
UI.prompt=_prompt;
UI.playMessage=playMessage;
String.prototype.text2HTML=function(){
return this.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split("\n").join("<br>").split(" ").join("&nbsp;");
};
function hideWaiting(){
var _1=$("dvSysMsg");
if(_1){
El.hide(_1);
}
UI.waiting=false;
}
function showWaiting(_2){
var _3=$("dvSysMsg");
if(_3){
document.getElementsByClassName("smTxt",_3)[0].innerHTML=_2+"...";
El.show(_3);
UI.waiting=true;
}
}
function _alert(_4,_5){
new UI.SysDialog({body:_4,action:_5});
}
function _txtMsgPrepare(_6){
return _6.text2HTML();
}
function _sysIcon(_7,_8){
return ["<table><tr><td valign=\"top\"><i class=\"bico brig ",({"alert":"alert","confirm":"confirm"}[_8]||""),"\"></i></td><td>",_7,"</td></tr></table>"].join("");
}
function _confirm(_9){
new UI.SysDialog({body:_9.message,button:"OK_CANCEL",actions:[_9.yes,_9.no]});
}
function _prompt(_a,_b,_c,_d,_e){
var _f="<div style='margin:20px;'><nobr>"+_b+" <br><br><input size=60 value='"+_c.escapeHTML()+"' type="+(_e?"password":"text")+" />"+"</nobr></div>";
new UI.Dialog({title:_a,body:_f,activate:function(div){
Field.activate(div.getElementsByTagName("input")[0]);
},action:function(div){
return _d(div.getElementsByTagName("input")[0]);
}});
}
var _12;
function playMessage(msg){
stopPlaying();
var _14=$doc().body.clientHeight;
var _15="<div id=\"nmAlert\" style=\"top:"+_14+"px\">"+"<div class=\"header bgF2 fgn\"><b class=\"btnS icoTipMsg\"></b>"+msg+"</div></div>";
new Insertion.Bottom($doc().body,_15);
$("nmAlert").onclick=stopPlaying;
_12=setTimeout(fadeIn);
}
function stopPlaying(){
clearTimeout(_12);
var div=$("nmAlert");
if(div){
Element.remove(div);
}
}
function fadeIn(){
var div=$("nmAlert");
var _18=$doc().body.clientHeight;
var _19=$doc().body.scrollTop;
if((div.offsetTop+div.offsetHeight)<(_18+_19-2)){
_12=setTimeout(fadeOut,5000);
}else{
div.style.top=(div.offsetTop-2)+"px";
_12=setTimeout(fadeIn,50);
}
}
function fadeOut(){
var div=$("nmAlert");
if(!div){
return;
}
var _1b=$doc().body.clientHeight;
var _1c=$doc().body.scrollTop;
if(div.offsetTop>(_1b+_1c)){
Element.remove(div);
}else{
div.style.top=(div.offsetTop+2)+"px";
_12=setTimeout(fadeOut,50);
}
}
})();
function $doc(){
return $win().document;
}
function $win(){
return parent;//.frames["indexFrame"];
}
function $(){
var _1d=[];
for(var i=0;i<arguments.length;i++){
var _1f=arguments[i];
if(typeof _1f=="string"){
_1f=$doc().getElementById(_1f);
}
if(arguments.length==1){
return _1f;
}
_1d.push(_1f);
}
return _1d;
}

(function(){
UI.TreeView=TreeView;
var _1;
TreeView.setActive=function(_2,_3){
var _4;
if(_4=$(_1)){
_4.className=getLinkClassName();
}
if(_4=$(_2)){
_1=_2;
expandIntoView(_4,true);
}else{
_1=null;
}
};
TreeView.createChild=function(_5,_6,_7){
findView(_5)._edit(_5,_6,true,_7||gLang.GLOBAL["nonamed"]);
};
TreeView.renameNode=function(_8,_9,_a){
findView(_8)._edit(_8,_9,false,_a);
};
function TreeView(_b,tm,_d){
_d=Object.extend({defaultIcon:"icoMfd"},_d);
var _e={};
var _f={};
this.render=function(){
_f={};
$(_b).innerHTML=new ViewGenerater().renderRoots();
$(_b)._view=this;
$(_b).oncontextmenu=onContextMenu;
};
function ViewGenerater(){
var _10="";
var _11;
this.renderRoots=renderRoots;
this.renderDeferral=renderDeferral;
function renderRoots(){
var _12=$$A(tm.getRoot());
for(var i=0;i<_12.length;i++){
_11=_12[i];
renderNode(_12[i]);
}
return _10;
}
function renderDeferral(_14){
var _15=_f[_14]||{};
_11=_15.root;
doChildren(_15.children||[]);
delete _f[_14];
return _10;
}
function doChildren(_16){
for(var i=0;i<_16.length;i++){
renderNode(tm.getNode(_16[i],_11));
}
}
function renderNode(_18){
var _19=$$A(_18.icon||_d.defaultIcon);
var _1a=_18.name||gLang.GLOBAL["nonamed"];
var _1b=_18.children||[];
var _1c=_18.link||{};
_10+="<li "+getActionScript(_1c);
if(_18.id){
_10+=" onmouseover=\"fFolderOver(this)\" onmouseout=\"fFolderOut(this)\"";
}
_10+=">";
if(_1b.length>0){
var _1d=_18.expand||(_18.id?_e[_18.id]:true);
if(_1d){
_10+="<b class=\"btnT icoClose\"";
}else{
_10+="<b class=\"btnT icoOpen\"";
}
_10+=" onmousedown=\"if ($js().Event.isLeftClick(event)) fGoto1('UI.TreeView.toggle', this);\"></b>";
}
var _1e=(_1&&_1==_1c.id);
for(var i=0;i<_19.length;i++){
_10+="<b class=\"btnS "+_19[i]+"\""+"></b>";
}
_10+="<a href=\"javascript:fGoto()\" class=\""+getLinkClassName(_1e)+"\"";
if(_1c.id){
_10+=" id=\""+_1c.id+"\"";
}
var _20=_1c.title||_18.name;
if(_20){
_10+=" title=\""+_20.escapeHTML()+"\"";
}
_10+=">"+(_1c.html||_1a.escapeHTML())+"</a>";
var _21=$$A(_18.moreAction);
if(_21.length){
_10+=" <span class=\"lstOpt fbk3\">";
for(var i=0;i<_21.length;++i){
_10+=" <a"+(_21[i].disabled?(" style=\"color:#BBB\" onmousedown=fGoto1()"):(" href=\"javascript:fGoto()\""+getActionScript(_21[i])))+">"+_21[i].text+"</a>";
}
_10+="</span>";
}
_10+="</li>";
if(_1b.length>0){
if(_1d){
_10+="<li class=\"gSubFd\"><ul>";
}else{
_10+="<li class=\"gSubFd\" style=\"display:none\"><ul>";
}
if(_1d||!_18.id||!_1c.id){
doChildren(_1b);
}else{
_f[_18.id]={root:_11,children:_1b};
}
_10+="</ul></li>";
}
}
}
function getActionScript(o){
if(!o.moduleName&&!o.functionName){
return "";
}
var _23=o.moduleName?"MM.getModule":o.functionName;
var _24=o.moduleName?[o.moduleName]:(o.args||[]);
var s=" onmousedown=\"if ($js().Event.isLeftClick(event)) return fGoto1('"+_23+"'";
for(var i=0;i<_24.length;i++){
s+=","+getArg(_24[i]);
}
s+=")\"";
if(o.dblclick){
var f=o.dblclick;
var _28=o.dblArgs?o.dblArgs:[];
s+=" ondblclick=\"return fGoto1('"+f+"'";
for(var i=0;i<_28.length;i++){
s+=","+getArg(_24[i]);
}
s+=")\"";
}
return s;
function getArg(arg){
if(typeof arg=="string"){
return "'"+arg+"'";
}else{
if(typeof arg=="number"){
return arg;
}else{
return undefined;
}
}
}
}
function onContextMenu(_2a){
var _2b=Event.element(_2a=_2a||$win().event);
var _2c=_2b;
while(_2c.className.startsWith("btnS")){
_2c=_2c.nextSibling;
}
var _2d=false;
while(!(_2d=_2c.className.startsWith("btnName"))&&_2c.tagName.toUpperCase()!="LI"&&_2c!=this){
_2c=_2c.parentNode;
}
CC.getContextMenu(this.id,(_2d?_2c:_2b),_2a);
return false;
}
this._toggled=function(_2e,_2f){
var li=_2e.parentNode;
var lnk=li.getElementsByTagName("A")[0];
if(lnk.id){
var _32=tm.resolveIdFromLink(lnk.id);
if(_32){
_e[_32]=_2f?true:undefined;
if(_2f&&_f[_32]){
var ul=li.parentNode;
var _34=li.nextSibling;
if(_34!=null&&_34.className=="gSubFd"){
var _35=_34.firstChild;
if(_35&&_35.firstChild==null){
_35.innerHTML=new ViewGenerater().renderDeferral(_32);
}
}
}
}
}
};
this._edit=function(_36,_37,_38,_39){
var li=$(_36).parentNode;
var ul=li.parentNode;
if(_38){
var _3c=li.nextSibling;
if(_3c==null||_3c.className!="gSubFd"){
_3c=El.createElement("li");
_3c.className="gSubFd";
_3c.innerHTML="<ul></ul>";
ul.insertBefore(_3c,li.nextSibling);
}
ul=_3c.firstChild;
if(ul.getElementsByTagName("INPUT")[0]){
return;
}
li=El.createElement("LI");
li.innerHTML="<b class=\"btnS "+_d.defaultIcon+"\"></b>"+"<input type=\"text\" style=\"width:80px;border:1px #000000 solid;padding:2px;\" class=\"btnName\">";
ul.appendChild(li);
var _3d=tm.resolveIdFromLink(_36);
if(_3d){
_e[_3d]=true;
}
}else{
if(li.getElementsByTagName("INPUT")[0]){
return;
}
new Insertion.After(_36,"<input type=\"text\" style=\"width:80px;border:1px #000000 solid;padding:2px;\" class=\"btnName\">");
Element.hide(_36);
}
var _3e=li.getElementsByTagName("INPUT")[0];
_3e.value=_39||"";
_3e.onkeypress=onKeyPress;
_3e.onblur=onBlur;
expandIntoView(_3e,"ReName");
$doc().body.onselectstart=function(){
return true;
};
_3e.select();
function onKeyPress(ev){
ev=ev||$win().event;
if(ev.keyCode==Event.KEY_ESC){
doCancel(this);
}else{
if(ev.keyCode==Event.KEY_RETURN){
Event.stop(ev);
this.blur();
}
}
}
function onBlur(){
$doc().body.onselectstart=function(){
return false;
};
var id=_38?null:tm.resolveIdFromLink(_36);
if(_37(this,id)==false){
doCancel(this);
}
}
function doCancel(_41){
_41.onblur=null;
var _42=_41;
if(_38){
var li=_41.parentNode;
var ul=li.parentNode;
_42=(ul.getElementsByTagName("li")[1])?li:ul;
}else{
Element.show(_36);
}
Element.remove(_42);
}
};
}
function findView(obj){
var _46=$(obj).parentNode;
while(_46&&!_46._view){
_46=_46.parentNode;
}
return _46._view;
}
function expandIntoView(_47,_48){
_47.className=getLinkClassName(_48);
var li=_47.parentNode.parentNode.parentNode;
while(li.className=="gSubFd"){
if(li.style.display=="none"){
UI.TreeView.toggle(li.previousSibling.firstChild);
}
li=li.parentNode.parentNode;
}
}
function getLinkClassName(_4a){
if(_4a==true||_4a=="active"){
return "btnName bgcolor3 fw";
}else{
if(_4a==false||_4a==null){
return "btnName fbk3";
}else{
return "btnName "+_4a;
}
}
}
TreeView.toggle=function(_4b){
var li=_4b.parentNode.nextSibling;
if(li.className=="gSubFd"){
Element.toggle(li);
var _4d=Element.visible(li);
_4b.className=_4d?"btnT icoClose":"btnT icoOpen";
findView(_4b)._toggled(_4b,_4d);
}
CC.resetNavScroll();
};
})();

(function(){
UI.Dialog=Dialog;
UI.SysDialog=function(){
Dialog.apply(this,arguments);
};
var _1=[];
Dialog.closeAll=function(){
var _2;
while(_2=_1.last()){
_2.cancel();
}
};
Dialog.top=function(){
return _1.last();
};
var _3={SYS:"<div class=\"sysWin\"><table style=\"width:300px;\">"+"<tr><td class=\"bgF1 top_le\">&nbsp;</td>"+"<td class=\"bgF2 topbg\"><b class=\"btnS top_ico\"></b>"+"<div class=\"top_txt\"><b class=\"fgn\">$TITLE$</b></div>"+"</td>"+"<td class=\"bgF1 top_ri\">&nbsp;</td></tr>"+"<tr><td class=\"bgF1 mid_le\"></td>"+"<td class=\"mid_cn\" nowrap>"+"<div class=\"mid_msg\"><span style=\"width:10px;\">$BODY$</span></div>"+"<div class=\"mid_btns\">$BUTTONS$</div></td>"+"<td class=\"bgF1 mid_ri\"></td></tr>"+"<tr><td class=\"bgF1 bot_le\"></td>"+"<td class=\"bgF2 botbg\">&nbsp;</td>"+"<td class=\"bgF1 bot_ri\"></td></tr>"+"</table></div>",FORM:"<div class=\"wbdyOut\"><table style=\"width:300px;\" class=\"wbdy\">"+"<tr><td>"+"<div class=\"whd\"><b class=\"fLeft fgy\" style=\"display:block;height:23px;overflow:hidden;text-overflow:ellipsis;\">$TITLE$</b>"+"<a href=\"javascript:fGoto()\" class=\"btnS btnClose wClos\" hidefocus>$CLOSE$</a></div>"+"<div class=\"wCtn\">$BODY$</div></td></tr>"+"<tr><td align=center style=\"padding:4px;\">$BUTTONS$</td></tr></table></div>"};
function Dialog(_4){
var _5=this;
var _6=$("dvSystemMsg");
var _7=El.createElement("div");
var _8=(this.constructor==UI.SysDialog)?"SYS":"FORM";
var _9=_4.button||((this.constructor==UI.SysDialog)?"OK":"OK_CANCEL");
var _a=_4.title||((this.constructor==UI.SysDialog)?gLang.dialog.sysmsg_title:"");
var _b=_4.actions||[_4.action];
var _c={div:_7};
_5.ok=fButtonClick.bind(null,0);
_5.cancel=fClose;
_5.adjust=fAdjust.bind(null,_c);
var _d;
function fShow(){
_7.style.cssText="position:absolute;z-index:999;top:0;left:0;display:none";
if(_6.style.display=="none"){
if(GE.IsIE){
_6.innerHTML="<div style=\"position:absolute;z-index:998;top:0;left:0;width:105%;height:100%;filter:alpha(opacity=40);\">"+"<div style=\"position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background-color:#000000;\"></div>"+"<iframe style=\"position:absolute;z-index:-1;top:0;left:0;width:100%;height:100%;\" frameborder=0 src=\"about:blank\"></iframe>"+"</div>";
}else{
_6.innerHTML="<div style=\"position:absolute;z-index:998;top:0;left:0;width:100%;height:100%;background-color:#000000;-moz-opacity:0.4;\"></div>";
}
}
var _e=_6.lastChild.previousSibling;
if(_e){
_e.style.zIndex=997;
}
_1.push(_5);
_6.insertBefore(_7,_6.lastChild);
formCallback(_4.init);
_7.style.display="block";
_6.style.display="block";
_5.adjust();
fSetDragAble(_7,_d);
formCallback(_4.activate);
}
function formCallback(_f,_10){
return (_f||Prototype.emptyFunction)(_10||_d.getElementsByTagName("FORM")[0]||_d,_5);
}
function fButtonClick(_11){
if(formCallback(_b[_11])===false){
return;
}
fClose();
}
function fClose(){
if(!_1.remove(_5)){
return;
}
_7.style.display="none";
_7.innerHTML="";
_6.removeChild(_7);
var _12=_6.lastChild.previousSibling;
if(_12){
_12.style.zIndex=999;
}else{
_6.style.display="none";
_6.innerHTML="";
if(MM[GE.laterRequestModule]){
MM[GE.laterRequestModule].focus();
}
}
}
_7.innerHTML=_3[_8];
var _13;
for(var i=0,elements=_7.getElementsByTagName("*");elements[i];i++){
if(elements[i].childNodes.length==1&&elements[i].firstChild.nodeType==3){
var s=elements[i].firstChild.data;
elements[i].removeChild(elements[i].firstChild);
if(s=="$TITLE$"){
elements[i].innerHTML=_a;
}else{
if(s=="$BODY$"){
_d=elements[i];
}else{
if(s=="$BUTTONS$"){
_13=elements[i];
}else{
if(s=="$CLOSE$"){
elements[i].onclick=fClose;
}
}
}
}
}
}
_c.body=_d;
_d.innerHTML=_4.body;
function getButton(key){
return "<input class=\"btnFn\" type=\"button\" value=\""+(_4["text"+key]||gLang.dialog.btn[key.toLowerCase()])+"\" />";
}
if(_9=="OK"){
_13.innerHTML=getButton("OK");
}else{
_13.innerHTML=getButton("OK")+" &nbsp; &nbsp; "+getButton("Cancel");
}
for(var i=0;i<_13.getElementsByTagName("input").length;i++){
_13.getElementsByTagName("input")[i].onclick=fButtonClick.bind(null,i);
}
fShow();
fFocus();
function fFocus(){
var all=_d.getElementsByTagName("*");
var _18;
for(var i=0,e;e=all[i];i++){
var _1a=e.tagName.toUpperCase();
if((_1a=="INPUT"&&(e.type=="text"||e.type=="password"||e.type=="input"))||_1a=="SELECT"||_1a=="TEXTAREA"){
if(!e.disabled&&!e.readOnly){
if(e.tabIndex==0){
e.focus();
return;
}else{
if(!_18){
_18=e;
}
}
}
}
}
(_18||_13.getElementsByTagName("input")[0]).focus();
}
}
window.fSetDragAble=function fSetDragAble(obj,_1c){
obj.onmousedown=mousedown;
var _1d,downY;
function mousedown(_1e){
var _1f=Event.element(_1e=_1e||$win().event);
if(_1c){
var _20=_1f;
while(_20!=null&&_20!=_1c){
_20=_20.parentNode;
}
if(_20==_1c){
return;
}
}
if(!_1f||!_1f.tagName||_1f.tagName.toUpperCase()=="INPUT"||_1f.tagName.toUpperCase()=="SELECT"||_1f.tagName.toUpperCase()=="TEXTAREA"||_1f.tagName.toUpperCase()=="OPTION"||_1f.onclick!=null||_1f.onmousedown!=null){
return;
}
_1d=_1e.clientX;
downY=_1e.clientY;
if(obj.setCapture){
obj.setCapture();
obj.onmousemove=mousemove;
obj.onmouseup=function(){
obj.releaseCapture();
obj.onmousemove=null;
obj.onmouseup=null;
};
}else{
if(window.captureEvents){
$win().captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
$win().onmousemove=mousemove;
$win().onmouseup=function(){
$win().releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
$win().onmousemove=null;
$win().onmouseup=null;
};
}
}
Event.stop(_1e);
}
function mousemove(_21){
_21=_21||$win().event;
var x=_21.clientX-_1d;
var y=_21.clientY-downY;
obj.style.top=parseInt(obj.style.top,10)+y+"px";
obj.style.left=parseInt(obj.style.left,10)+x+"px";
_1d=_21.clientX;
downY=_21.clientY;
}
};
Dialog.openImage=function(_24,_25,_26,_27,_28){
var _29=_26;
var _2a=_27;
var _2b=_25;
var _2c;
if(_26&&_27){
_24+=" - "+_26+" x "+_27+" "+gLang.GLOBAL.pixel;
if(caculateScaling()){
_2b=_28(_29,_2a);
_24+=" - <span>"+String.format(gLang.img.scale,Number.getPercent(_2c))+"</span>";
}
}
var _2d="<div style=\"text-align:center\"><img src=\""+_2b+"\" /></div>";
new Dialog({init:function(div){
var img=div.getElementsByTagName("img")[0];
if(_29&&_2a){
applyDimensions(img);
}else{
img.onresize=img.onload=calculateActualDimensions;
}
},title:_24,body:_2d,button:"OK"});
function calculateActualDimensions(){
var img=this;
img.onload=img.resize=null;
_26=img.width;
_27=img.height;
if(caculateScaling()){
applyDimensions(img);
}
Dialog.top().adjust();
}
function applyDimensions(img){
img.width=_29;
img.height=_2a;
if(_2c){
img.style.cursor=(document.all)?"hand":"pointer";
img.onclick=function(){
window.open(_25);
};
}
}
function caculateScaling(){
var _32=Math.max(GE.bodyWidth-50,50);
var _33=Math.max(GE.bodyHeight-120,50);
var _34=Math.min(_32/_26,_33/_27);
var _35=(0<_34&&_34<1);
if(_35){
_2c=_34;
_29=Math.round(_26*_2c);
_2a=Math.round(_27*_2c);
}
return _35;
}
};
function fAdjust(_36){
var _37=$doc().body;
var div=_36.div;
var _39=_36.body;
var _3a=_37.clientWidth;
var _3b=_37.clientHeight;
var _3c=10,minWidth=50,scrollBarWidth=18;
_39.style.height=_39.scrollHeight+"px";
_39.style.width=_39.scrollWidth+"px";
var h=div.offsetHeight;
var w=div.offsetWidth;
var _3f=false,wOverflow=false;
if(_3b<=h){
var _40=h-_3b;
_39.style.overflowY="scroll";
var _41=_39.scrollHeight-_40-scrollBarWidth;
_41=_41>_3c?_41:_3c;
_39.style.height=_41+"px";
_3f=true;
}
if(_3a<=w){
var _42=w-_3a;
_39.style.overflowX="scroll";
var _43=_39.scrollWidth-_42-scrollBarWidth;
_43=_43>minWidth?_43:minWidth;
_39.style.width=_43+"px";
wOverflow=true;
}
if(!GE.IsIE){
if(_3f&&wOverflow){
}else{
if(!_3f&&!wOverflow){
}else{
if(_3f){
_39.style.width=(_39.scrollWidth+scrollBarWidth)+"px";
}else{
_39.style.height=(_39.scrollHeight+scrollBarWidth)+"px";
}
}
}
}
h=div.offsetHeight;
w=div.offsetWidth;
div.style.left=""+Math.floor(Math.max(0,_3a-w)/2)+"px";
div.style.top=""+Math.floor(Math.max(0,_3b-h)/2)+"px";
_37.scrollTop=_37.scrollLeft=0;
}
})();

(function(){
var _1={};
var _2={};
var _3={};
UI.Toolbar={show:toolbarShow,getButton:function(_4,_5,_6,_7){
return newOption(_1,_4,_5,_6,_7);
},getMenu:function(_8,_9,_a,_b){
return newOption(_2,_8,_9,_a,_b);
},getMenuButton:function(_c,_d,_e,_f){
return newOption(_3,_c,_d,_e,_f);
}};
window.toolbarOption=function(_10,_11,_12,_13,_14,_15,_16,_17,_18){
Object.extend(this,{style:(_13)?_2:((_14)?_3:_1),command:_10,clickEvent:_12,text:_11,iconClass:_18&&_16,divClass:_17,splitNext:_15});
};
function newOption(_19,_1a,_1b,_1c,_1d){
return {style:_19,command:_1a,text:_1b,iconClass:_1c,divClass:"tlbtn1",disabled:_1d};
}
function toolbarShow(_1e,_1f){
var _20=_1f[0];
var _21=_1f[1];
var _22=$("dvToolbar");
El.hide(_22);
_22.innerHTML="";
append("<div class=\"bgF1 tlbar_l\"></div>");
append(_20||("<nobr>"+CC.getTips()+"</nobr>"));
append("<div class=\"bgF1 fRig tlbar_r\"></div>");
append(_21);
El.show(_22);
function append(_23){
try{
if(typeof _23=="string"){
new Insertion.Bottom(_22,_23);
}else{
_23.each(appendOne);
}
}
catch(exp){
fDebug("toolbarCreate.append",exp);
}
}
function appendOne(_24){
if(!_24){
addSplitLine();
return;
}
var _25="<div class=\""+(_24.divClass)+"\"><table";
if(_24.disabled){
_25+=" style='-moz-opacity:0.3;filter:alpha(opacity=30);cursor:default;'";
}
_25+="><tr><td class=\"bgF1 tbtn_l\"></td>";
if(_24.iconClass){
_25+="<td class=\"bgF2 tbtn_m\"><b class=\"btnS icoBtn "+_24.iconClass+"\"></b></td>";
}else{
_25+="<td class=\"bgF2 tbtn_m\">&nbsp;</td>";
}
_25+="<td class=\"bgF2 tbtn_m\">"+_24.text+"</td>";
switch(_24.style){
case _3:
_25+="<td class=\"bgF2 tbtn_m\"><b class=\"btnS btnExp\"></b></td>";
break;
case _2:
_25+="<td class=\"bgF2 tbtn_m\"><b class=\"btnS btnExp2\"></b></td>";
break;
}
_25+="<td class=\"bgF1 tbtn_r\"></td></tr></table></div>";
append(_25);
if(!_24.disabled){
var _26=_22.lastChild.firstChild;
Object.extend(_26,getButtonEvents(_24,_1e));
}
if(_24.splitNext){
addSplitLine();
}
}
function addSplitLine(){
append("<b class=\"tlbSep bgF1\"></b>");
}
}
function getButtonEvents(_27,_28){
var _29;
return {onclick:buttonOnClick,onmouseover:buttonOnHover,onmouseout:buttonOnLeave,onmousedown:buttonOnMouseDown,onmouseup:buttonOnMouseUp};
function buttonOnHover(){
if(!CMenu.isShowing()){
El.addClass(this,"over");
}
}
function buttonOnLeave(){
if(!this.getAttribute("isMenu")){
this.className="";
}
}
function buttonOnMouseDown(_2a){
_2a=_2a||$win().event;
if(this.getAttribute("isMenu")){
CMenu.hide();
_29=true;
}else{
if(isDropDownEvent(this,_2a)){
this.setAttribute("isMenu",true);
fButtonMenu(this,_2a,MM[_28].getToolbarMenu(_27.command));
_29=true;
}
}
this.className="over click";
}
function buttonOnMouseUp(){
if(!this.getAttribute("isMenu")){
El.removeClass(this,"click");
}
}
function buttonOnClick(_2b){
_2b=_2b||$win().event;
if(_29){
_29=false;
Event.stop(_2b);
}else{
if(_27.clickEvent){
$win().eval(_27.clickEvent);
}else{
MM[_28].operate(_27.command);
}
}
}
function isDropDownEvent(_2c,_2d){
return (_27.style==_2||isTargetAtDownArrow(_2c,_2d));
}
function isTargetAtDownArrow(_2e,_2f){
var _30=Event.element(_2f);
var _31=document.getElementsByClassName("btnExp.?",_2e)[0];
return (_31&&((_30==_31)||(_30==_31.parentNode)||(_30==_31.parentNode.nextSibling)));
}
}
})();
function fButtonMenu(_32,_33,_34){
var pos=El.position(_32);
_34[0].left=pos[0];
_34[0].top=pos[1]+_32.offsetHeight;
_34[0].call=function(){
_32.setAttribute("isMenu",null);
_32.onmouseout();
};
CMenu.create(_34);
Event.stop(_33);
}

var CMenu=new ContextMenu();
function ContextMenu(){
this.name=["rcMenu","bgcolor4 fw","bgF2 tlmSep","fgy2","fgy bgcolor4"];
this.main=null;
this.call=null;
}
(function(){
ContextMenu.prototype.init=fMenuInit;
ContextMenu.prototype.createSubMenu=fMenuCreateSubMenu;
ContextMenu.prototype.create=fMenuCreate;
ContextMenu.prototype.show=fMenuShow;
ContextMenu.prototype.hide=fMenuHide;
ContextMenu.prototype.setStyle=fMenuSetStyle;
ContextMenu.prototype.isShowing=function(){
return this.main&&this.main.style.display=="block";
};
function fMenuInit(){
var ul=$doc().createElement("ul");
ul.className=this.name[0];
ul.style.zIndex="999";
ul.style.position="absolute";
ul.style.display="none";
ul.oncontextmenu=function(e){
Event.stop(e||$win().event);
};
var _3=$doc().createElement("div");
ul.appendChild(_3);
$doc().body.appendChild(ul);
this.main=ul;
}
function fMenuCreateSubMenu(o,_5){
var _6=_5;
var tl=_6.offsetLeft;
var tt=_6.offsetTop;
while(_6=_6.offsetParent){
tl+=_6.offsetLeft;
tt+=_6.offsetTop;
}
o[0].left=tl+_5.offsetWidth+1;
o[0].top=tt;
this.parent=_5;
this.create(o);
}
function fMenuCreate(o){
var _a=this;
_a.hide();
_a.setStyle(o[0]);
var n=[_a.name[1],_a.name[3],_a.name[4]];
function getV(o){
return (typeof o=="function")?o():o;
}
for(var i=1;i<o.length;i++){
var li=$doc().createElement("li");
li.parent=_a;
li.style.whiteSpace="nowrap";
if(o[i]!="empty"){
var _f=getV(o[i]);
if(o[i][0]){
_f={text:o[i][0]};
var a1=o[i][1];
if(typeof a1=="function"){
_f.action=a1;
if(typeof o[i][2]=="string"){
_f.extStyle=o[i][2];
}else{
if(typeof o[i][2]=="boolean"){
_f.checked=o[i][2];
}
}
}else{
if(typeof a1=="object"&&a1!=null){
_f.extObj=a1;
_f.checked=a1.checked;
}else{
if(a1){
_f.checked=true;
}else{
_f.disabled=true;
}
}
}
}
var _11=getV(_f.extStyle)||"";
var _12=getV(_f.text);
var _13;
if(getV(_f.selected)){
_13="<b class=\"trVm rmIco1 btnS icoSel "+_11+"\">&nbsp;</b><span>"+_12+"</span>";
}else{
if(getV(_f.checked)){
_13="<b class=\"trVm rmIco1 btnS icoChk "+_11+"\">&nbsp;</b><span>"+_12+"</span>";
}else{
if(_f.submenu){
li.submenu=_f.submenu;
_13="<b></b><div style=\"float:right;border:0px\" class=\"btnS icoSub\">&nbsp;</div><span>"+_12+"</span>";
}else{
if(_11){
_13="<b class=\"trVm rmIco1 btnS "+_11+"\"></b><span>"+_12+"</span>";
}else{
_13="<b></b><span>"+_12+"</span>";
}
}
}
}
li.innerHTML=_13;
li.onmouseover=function(){
this.className=n[0];
if(this.displaySub){
return;
}
var _14=this.parent.submenu;
if(_14&&_14.isShowing()){
_14.hide();
}
if(this.submenu){
if(!_14){
_14=new ContextMenu;
_14.init();
this.parent.submenu=_14;
}
_14.createSubMenu(getV(this.submenu),this);
}
};
li.onmouseout=function(){
var _15=this.parent.submenu;
if(_15&&_15.isShowing()){
return;
}
this.className="";
};
li.setAttribute("index",i);
if(getV(_f.disabled)){
li.className=n[1];
li.onclick=function(e){
Event.stop(e||$win().event);
};
li.onmouseover=function(){
this.className=n[2];
};
li.onmouseout=function(){
this.className=n[1];
};
}else{
if(_f.extObj){
li.extObj=_f.extObj;
li.onclick=function(){
_a.hide(true);
this.extObj.onclick();
};
}else{
if(_f.action){
li.action=_f.action;
li.onclick=function(){
_a.hide(true);
try{
this.action();
}
catch(ex){
fDebug("fMenuCreate.function",ex);
}
};
}else{
li.onclick=function(e){
Event.stop(e||$win().event);
};
}
}
}
}else{
li.className=_a.name[2];
li.onclick=function(e){
Event.stop(e||$win().event);
};
}
_a.main.firstChild.appendChild(li);
}
_a.show();
}
function fMenuShow(){
if(this.parent){
this.parent.displaySub=true;
}
this.main.style.display="block";
var n=this.main.offsetTop;
if(n+this.main.offsetHeight>GE.bodyHeight-3){
n=GE.bodyHeight-this.main.offsetHeight-3;
if(n<0){
n=0;
}
this.main.style.top=n+"px";
}
n=this.main.offsetLeft;
if(n+this.main.offsetWidth>GE.bodyWidth-3){
n=GE.bodyWidth-this.main.offsetWidth-3;
if(n<0){
n=0;
}
this.main.style.left=n+"px";
}
if(GE.IsIE){
var dw=this.main.offsetWidth;
var dh=this.main.offsetHeight;
var _1c=$doc().body;
if(!_1c){
return;
}
var _1d=this.main.cloneNode(false);
_1d.style.zIndex="390";
_1d.style.margin="0px";
_1d.style.padding="0px";
_1d.style.border="none";
_1d.innerHTML="<iframe width='"+dw+"' height='"+dh+"' frameborder='0'></iframe>";
_1c.insertBefore(_1d,_1c.firstChild);
this._underDiv=_1d;
}
if(GE.IsIE){
this.main.focus();
}
}
function fMenuHide(_1e){
if(this.main.style.display=="none"){
return;
}else{
if(this.parent){
this.parent.displaySub=false;
this.parent.className="";
if(_1e){
this.parent.parent.hide(true);
return;
}
}
if(this.submenu&&this.submenu.isShowing()){
this.submenu.hide();
}
this.main.style.display="none";
if(GE.IsIE&&this._underDiv){
El.remove(this._underDiv);
}
}
if(GE.IsIE){
this.main.outerHTML="";
this.init();
}else{
this.main.firstChild.innerHTML="";
}
if(this.call){
this.call();
this.call=null;
}
}
function fMenuSetStyle(o){
if(o.left&&o.width&&parseInt(o.left,10)+parseInt(o.width,10)>GE.bodyWidth-3){
o.left=GE.bodyWidth-o.width-3;
}
for(var p in o){
switch(p){
case "call":
this.call=o[p];
break;
default:
this.main.style[p]=o[p]+"px";
break;
}
}
}
})();

(function(){
UI.Tab=new TabLabel();
function TabLabel(){
this.name=["gTab0","gTab1","gTl bgF1","gTm bgF2","gTc bgF2","gTr bgF1","btnS btnClose","noIco","gTi bgF2 hasIco"];
this.main=null;
this.div=null;
this.cur=null;
this.tabs={};
this.group=[];
this.count=0;
this.width=-1;
this.max=170;
this.min=170;
this.history=[];
this.call=[];
this.text=[];
}
TabLabel.prototype.init=fTabInit;
TabLabel.prototype.add=fTabAdd;
TabLabel.prototype.exist=fTabExist;
TabLabel.prototype.del=fTabDel;
TabLabel.prototype.active=fTabActive;
TabLabel.prototype.title=fTabTitle;
TabLabel.prototype.icon=fTabIcon;
TabLabel.prototype.close=fTabClose;
TabLabel.prototype.change=fTabChange;
TabLabel.prototype.replace=fTabReplace;
TabLabel.prototype.size=fTabSize;
TabLabel.prototype.update=fTabUpdate;
function fTabInit(){
try{
var _1=$("R_tabArea");
this.win=$win();
this.doc=this.win.document;
this.main=_1;
this.div=this.main.firstChild;
this.width=_1.offsetWidth-150;
}
catch(e){
fDebug("fTabInit",e);
}
}
function fTabAdd(o){
var _3=this;
var _4=this.win;
var id=o.name;
var _6,tr,td,a;
_6=this.doc.createElement("table");
_6.setAttribute("tabid",id);
_6.className=this.name[1];
_6.style.width=this.min+"px";
_6.onclick=function(){
var _7=this.getAttribute("tabid");
if(_3.exist(_7)==_3.cur){
return;
}
_3.active(_7);
};
_6.title=o.text.stripTags();
tr=_6.insertRow(-1);
td=tr.insertCell(-1);
td.className=this.name[2];
td=tr.insertCell(-1);
td.className=this.name[8];
if(o.icon){
td.innerHTML="<b class=\""+o.icon+"\"></b>";
}else{
td.innerHTML="<b class=\""+this.name[7]+"\"></b>";
}
td=tr.insertCell(-1);
td.className=this.name[3];
td.innerHTML="<nobr>"+o.text+"</nobr>";
td=tr.insertCell(-1);
td.className=this.name[4];
if(!o.close){
a=this.doc.createElement("a");
a.href="javascript:fGoto()";
a.title=this.text[0];
a.hideFocus=true;
a.className=this.name[6];
a.onclick=function(e){
$win().fHideMenu();
var _9=this.parentNode.parentNode.parentNode.parentNode.getAttribute("tabid");
if(_3.call[2](_9)){
_3.del(_9);
}
if(e!="close"){
Event.stop(e?e:_4.event);
}
return false;
};
td.appendChild(a);
}
td=tr.insertCell(-1);
td.className=this.name[5];
this.main.insertBefore(_6,this.div);
this.tabs[id]=_6;
this.active(id);
this.count++;
this.size();
if(o.group){
var _a=this.group[o.group];
if(_a&&_a!=id&&this.exist(_a)){
this.replace(_a,id);
}
this.group[o.group]=id;
}
}
function fTabExist(id){
var _c=this.tabs[id];
if(_c&&_c.getAttribute("tabid")){
return _c;
}else{
return null;
}
}
function fTabDel(id){
var _e=this.exist(id);
if(!_e){
fDebug("Tab Del Error");
return;
}
if(this.cur==_e){
this.cur=null;
}
this.main.removeChild(_e);
delete this.tabs[id];
this.count--;
this.size();
if(this.call[0]){
this.call[0](id);
}
this.update(id,false);
if(!this.cur&&this.history.length){
_e=this.history[this.history.length-1];
this.history.length--;
this.active(_e);
}
}
function fTabActive(id){
var tab=this.exist(id);
if(!tab){
fDebug("Tab Active Error");
return;
}
if(this.cur){
this.cur.className=this.name[0];
}
this.cur=tab;
this.cur.className=this.name[1];
if(this.call[1]){
this.call[1](id);
}
this.update(id,true);
}
function fTabTitle(id,_12){
var tab=this.exist(id);
if(!tab){
fDebug("Tab Title Error");
return;
}
var txt=tab.getElementsByTagName("nobr")[0];
if(_12){
txt.innerHTML=_12;
tab.title=_12.stripTags();
}else{
return txt.innerHTML;
}
}
function fTabIcon(id,_16){
var tab=this.exist(id);
if(!tab){
fDebug("Tab Icon Error");
return;
}
var td=tab.getElementsByTagName("td")[1];
var b=td.getElementsByTagName("b")[0];
if(typeof _16=="undefined"){
return b.className;
}else{
if(_16){
b.className=_16;
}else{
b.className=this.name[7];
}
}
}
function fTabClose(id){
var tab=this.exist(id);
if(tab){
var a=tab.getElementsByTagName("a")[0];
if(a){
a.onclick("close");
return true;
}
}
return false;
}
function fTabChange(id,_1e,_1f,_20){
var tab=this.exist(id);
if(!tab){
fDebug("Tab Change Error");
return;
}
if(_20){
this.icon(id,_20);
}
if(_1e){
this.title(id,_1e);
}
delete this.tabs[id];
tab.setAttribute("tabid",_1f);
this.tabs[_1f]=tab;
var i,l=this.history.length;
for(i=0;i<l;i++){
if(this.history[i]==id){
this.history[i]=_1f;
break;
}
}
}
function fTabReplace(_23,_24){
var tab=this.exist(_23)&&this.exist(_24);
if(!tab){
fDebug("Tab Replace Error");
return;
}
var _26=this.title(_24);
var _27=this.icon(_24);
this.cur=this.exist(_23);
this.del(_24);
this.change(_23,_26,_24,_27);
this.active(_24);
}
function fTabSize(w){
var tab,i,k=3;
if(w){
this.width=w;
}
if(this.count*(this.max+k)>this.width){
this.min=Math.floor((this.width-this.count*k)/this.count);
}else{
this.min=this.max;
}
for(i in this.tabs){
tab=this.exist(i);
if(tab){
tab.style.width=this.min+"px";
}
}
}
function fTabUpdate(id,_2b){
var i,l=this.history.length;
var t,a=[];
for(i=0;i<l;i++){
t=this.history[i];
if(t!=id){
a[a.length]=t;
}
}
if(_2b){
a[a.length]=id;
}
this.history=a;
}
})();

(function(){
window.DG=null;
UI.DataGrid=DataGrid;
DataGrid.prototype={create:fdg_Create,refresh:fdg_Refresh,setDG:function(){
window.DG=this;
},focus:fdg_Focus,cookiePrefix:"",getDataSpec:null,selectAll:fSelectAll};
var _1=10;
function DataGrid(){
var DG=window.DG=this;
fdg_SystemInstance(DG);
DG.System.setData=fdg_SetData;
DG.System.getData=fdg_GetData;
DG.System.setDataOBO=fdg_SetDataOBO;
DG.System.setTitle=fdg_SetTitle;
DG.System.getTitle=fdg_GetTitle;
DG.System.setParentNode=fdg_SetParentNode;
DG.System.getParentNode=fdg_GetParentNode;
DG.System.initContainer=fdg_InitContainer;
DG.System.initData=fdg_InitData;
DG.System.initDataOBO=fdg_InitDataOBO;
DG.System.initTitle=fdg_InitTitle;
DG.System.initContainerEvent=fdg_InitContainerEvent;
DG.System.initDataEvent=fdg_InitDataEvent;
DG.System.initTitleEvent=fdg_InitTitleEvent;
DG.System.initTitleDragEvent=fdg_InitTitleDragEvent;
DG.System.sortTableIndex=fdg_SortTableIndex;
fdg_HTMLInstance(DG);
DG.HTML.createHTMLObject=fdg_CreateHTMLObject;
DG.HTML.getElementByID=fdg_GetObjectByID;
DG.HTML.getSelectTarget=fdg_GetLastSelectTarget;
DG.HTML.getSelectTargetArray=fdg_GetSelectTargetArray;
DG.HTML.setTitleOnClick=fdg_SetTitleOnClick;
DG.HTML.setTitleOnDblClick=fdg_SetTitleOnDblClick;
DG.HTML.setTitleOnContextmenu=fdg_SetTitleOnContextmenu;
DG.HTML.setContainerOnClick=fdg_SetContainerOnClick;
DG.HTML.setDataOnClick=fdg_SetDataOnClick;
DG.HTML.setDataOnDblClick=fdg_SetDataOnDblClick;
DG.HTML.setDataOnContextmenu=fdg_SetDataOnContextmenu;
DG.HTML.setDataOnMouseOver=fdg_SetDataOnMouseOver;
DG.HTML.setDataOnMouseOut=fdg_SetDataOnMouseOut;
DG.HTML.setDataOnMouseDown=fdg_SetDataOnMouseDown;
DG.HTML.setDataOnMouseUp=fdg_SetDataOnMouseUp;
DG.HTML.setDataOnMouseDrag=fdg_SetDataOnMouseDrag;
DG.HTML.setDataOnKeyDown=fdg_SetDataOnKeyDown;
DG.HTML.setDataOnKeyPress=fdg_SetDataOnKeyPress;
DG.HTML.setDataOnKeyUp=fdg_SetDataOnKeyUp;
DG.HTML.onBlurHTMLObject=fdg_OnBlurHTMLObject;
DG.HTML.onFocusHTMLObject=fdg_OnFocusHTMLObject;
DG.HTML.setLastSelectFocus=fdg_SetLastSelectFocus;
DG.HTML.changeMailStatus=fdg_ChangeDataCellValue;
fdg_CSSInstance(DG);
DG.CSS.setTitleCSS=fdg_SetTitleCss;
DG.CSS.getTitleCSS=fdg_GetTitleCss;
DG.CSS.setDataCSS=fdg_SetDataCss;
DG.CSS.getDataCSS=fdg_GetDataCss;
}
function fdg_Create(){
var DG=this;
if(DG.System.isCreated){
return;
}
try{
DG.HTML.createHTMLObject();
DG.System.initTitle();
DG.System.initContainer();
DG.System.initData();
fdg_InitEvent();
var _4=DG.System.getParentNode();
_4.appendChild(DG.HTML.Object);
DG.System.isCreated=true;
}
catch(e){
fDebug("fdg_Create",e);
}
}
function fdg_Refresh(){
var DG=this;
if(!DG.System.isCreated){
return;
}
DG.System.dataOBO=null;
DG.System.dataOBOLen=0;
DG.HTML.LastSelectTarget=null;
DG.HTML.SelectTargetArray=[];
DG.HTML.Data.lastSystemKey="";
DG.HTML.dgDataNode.innerHTML="";
DG.System.initData();
}
function fdg_Focus(){
var DG=this;
try{
if(DG.HTML.LastSelectTarget!=null){
DG.HTML.LastSelectTarget.focus();
}
var _7=DG.HTML.SelectTargetArray;
var _8=_7.length;
for(var i=0;i<_8;i++){
fChangeSelectCss(DG,_7[i]);
}
}
catch(e){
fDebug("",e);
}
}
function fdg_SystemInstance(DG){
DG.System={DG:DG};
DG.System.isIE=document.all;
DG.System.title=null;
DG.System.data=null;
DG.System.dataOBO=null;
DG.System.dataOBOLen=0;
DG.System.parentNode=null;
DG.System.isCreated=false;
DG.System.sortColumn=null;
DG.System.sortBy="";
}
function fdg_CSSInstance(DG){
DG.CSS={DG:DG};
DG.CSS.titleCSS=null;
DG.CSS.dataCSS=null;
DG.CSS.dgTitleDiv="bgF2 rm_tableHeadersWrapper";
DG.CSS.dgTitleDivDrag="bgF1 noResize";
DG.CSS.dgTitleDivDragResize="bgF1 rm_msgTableResizerHotspot eResizeCursor";
DG.CSS.dgTitleUpHTML="<B class=\"btnS msgIcon upIcon\"></B>";
DG.CSS.dgTitleDownHTML="<B class=\"btnS msgIcon downIcon\"></B>";
DG.CSS.dgDataDiv="PagedTableView_container";
DG.CSS.dgDataDivWidth="100%";
DG.CSS.dgDataDivHeight="190";
DG.CSS.dgDataDivTop="125";
DG.CSS.dgDataDivLeft="203";
DG.CSS.dgDataDivVisibility="visible";
DG.CSS.dgDataDiv2="PagedTableView_wrapper";
DG.CSS.dgDataRowHeight=20;
DG.CSS.dgDataTB="PagedTableView_table";
DG.CSS.dgDataTR_None="messageRow";
DG.CSS.dgDataTR_Select="messageRow bgcolor6";
DG.CSS.dgDataTR_SelectLost="messageRow bgcolor2";
DG.CSS.dgDataTR_New="messageRow fbold";
DG.CSS.dgDataTR_NewSelect="messageRow bgcolor6 fbold";
DG.CSS.dgDataTR_NewSelectLost="messageRow bgcolor2 fbold";
DG.CSS.dgDataPriorityHigh="tableIcon btnS importantIcon";
DG.CSS.dgDataPriorityLow="tableIcon btnS slowIcon";
DG.CSS.dgDataAttach="tableIcon btnS attachmentIcon";
DG.CSS.dgTitleStatus="";
DG.CSS.dgDataStatusDraft="tableIcon btnS drIcon";
DG.CSS.dgDataStatusSched="tableIcon btnS drIcon2";
DG.CSS.dgDataStatusTranReply="tableIcon btnS fwReIcon";
DG.CSS.dgDataStatusReply="tableIcon btnS reIcon";
DG.CSS.dgDataStatusTrans="tableIcon btnS fwIcon";
DG.CSS.dgDataStatusNewMail="tableIcon btnS newIcon";
DG.CSS.dgDataStatusReaded="tableIcon btnS oldIcon";
DG.CSS.dgDataVirus_unscan="";
DG.CSS.dgDataVirus_novirus="";
DG.CSS.dgDataVirus_cleaned="tableIcon btnS virusCleanedIcon";
DG.CSS.dgDataVirus_infected="tableIcon btnS virusInfectedIcon";
DG.CSS.dgDataVirus_undetermined="tableIcon btnS virusUndeterminedIcon";
}
function fdg_SetData(_c){
var DG=this.DG;
if(typeof _c=="object"){
DG.System.data=_c;
}
}
function fdg_GetData(){
var DG=this.DG;
return DG.System.data;
}
function fdg_SetDataOBO(_f){
var DG=this.DG;
if(typeof _f!="object"){
return;
}
if(DG.System.dataOBO==null){
var a=[];
a[0]=_f;
DG.System.dataOBO=a;
DG.System.dataOBOLen=1;
if(DG.System.data!=null){
DG.System.data[DG.System.data.length]=_f;
}
}else{
if(DG.System.dataOBOLen==1){
DG.System.dataOBOLen=2;
DG.System.dataOBO[DG.System.dataOBO.length]=_f;
if(DG.System.data==null){
var a=[];
a[0]=DG.System.dataOBO[0];
a[1]=DG.System.dataOBO[1];
DG.System.data=a;
}else{
DG.System.data[DG.System.data.length]=_f;
}
}else{
DG.System.dataOBO[DG.System.dataOBO.length]=_f;
DG.System.data[DG.System.data.length]=_f;
}
}
if(DG.System.isCreated){
DG.System.initDataOBO(_f);
DG.System.sortTableIndex();
}
}
function fdg_SortTableIndex(){
var DG=this.DG;
var _13=DG.HTML.dgDataNode.childNodes;
var k=_13.length;
var len=_13.length;
for(var i=0;i<len;i++){
k--;
_13[i].index=k;
}
}
function fdg_SetTitle(_17){
var DG=this.DG;
if(typeof _17=="object"){
DG.System.title=_17;
}
}
function fdg_GetTitle(){
var DG=this.DG;
return DG.System.title;
}
function fdg_SetParentNode(_1a){
var DG=this.DG;
if(typeof _1a=="object"){
DG.System.parentNode=_1a;
}
}
function fdg_GetParentNode(){
var DG=this.DG;
return DG.System.parentNode;
}
function fdg_InitTitle(){
var DG=this.DG;
var oT=DG.HTML.dgTitleNode;
var a=DG.System.title;
var _20=DG.CSS.titleCSS;
try{
if(a.length<1){
return;
}
oT.innerHTML="";
var len=a.length;
for(var i=0;i<len;i++){
var _23=fdg_CreateElement("DIV");
var _24=fdg_CreateElement("DIV");
var str=a[i][0];
if(a[i][1]){
str="<img src='"+a[i][1]+"'>";
}
_23.id="dgTitle1obj_"+_1+"_"+i+"_0";
if(a[i][2]){
_23.title=a[i][2];
}
if(_20[i][3]){
_23.className=_20[i][3];
}
if(_20[i][0]>0){
_23.style.left=_20[i][0]+"px";
}else{
_23.style.left=0;
}
_23.style.width=_20[i][1]+"px";
_23.isSort=a[i][3];
_23.displayArrow=a[i][0]>"";
_23.index=i;
DG.System.initTitleEvent(_23,a[i][3]);
var _26=fdg_CreateElement("DIV");
_26.id="dgTitle3obj_"+_1+"_"+i+"_1";
_26.index=i;
if(_20[i][4]){
_26.className=_20[i][4];
}
_26.innerHTML=str;
_23.appendChild(_26);
if(_23.displayArrow&&i==DG.System.sortColumn){
_23.innerHTML+=DG.System.sortBy;
}
oT.appendChild(_23);
_24.id="dgDrag2obj_"+_1+"_"+i;
var _27=a[i][4];
if(_27){
_24.className=DG.CSS.dgTitleDivDragResize;
}else{
_24.className=DG.CSS.dgTitleDivDrag;
}
_24.style.left=_20[i][2]+"px";
_24.index=i;
DG.System.initTitleDragEvent(_24,_27);
oT.appendChild(_24);
}
}
catch(e){
fDebug("fdg_InitTitle",e);
}
}
function fdg_InitTitleEvent(obj,_29){
var DG=this.DG;
if(_29==""){
return;
}
obj.ondblclick=DG.HTML.Title.onDblClick;
obj.onclick=DG.HTML.Title.onClick;
obj.oncontextmenu=DG.HTML.Title.onContextmenu;
}
function fdg_InitTitleDragEvent(obj,_2c){
var DG=this.DG;
if(!_2c){
return;
}
obj.onmousedown=DG.HTML.Title.dragOnMousedown;
}
function fdg_InitContainer(){
var DG=this.DG;
var obj=DG.HTML.dgDataContainer;
try{
DG.System.initContainerEvent(obj);
}
catch(e){
fDebug("fdg_InitContainer",e);
}
}
function fdg_InitData(){
var DG=this.DG;
var obj=DG.HTML.dgDataNode;
var a=DG.System.data;
try{
var k=a.length;
var _34=a.length;
for(var i=0;i<_34;i++){
k--;
var _36=fdg_InitDataNode(DG,a[i],i,k);
obj.appendChild(_36);
}
}
catch(e){
fDebug("fdg_InitData",e);
}
}
function fdg_InitDataOBO(_37){
var DG=this.DG;
if(_37==null){
return;
}
var obj=DG.HTML.dgDataNode;
var l=0;
if(DG.System.data==null){
if(DG.System.dataOBO.length==2){
l=1;
}
}else{
l=DG.System.data.length-1;
}
try{
obj.appendChild(fdg_InitDataNode(DG,_37,l,l));
}
catch(e){
fDebug("fdg_InitDataOBO",e);
}
}
function fdg_InitDataNode(DG,a,i,k){
var c=DG.CSS.dataCSS;
var _40=fdg_CreateElement("TABLE");
_40.id="dgData_Table_"+_1+"_"+i;
_40.index=k;
_40.cellPadding=0;
_40.className=DG.CSS.dgDataTB;
var _41=fdg_CreateElement("TBODY");
_40.appendChild(_41);
var oTr=fdg_CreateElement("TR");
oTr.id="dgData_Tr_"+_1+"_"+i;
var _43=DG.getDataSpec(a);
if(_43.isNew){
oTr.className=DG.CSS.dgDataTR_New;
}else{
oTr.className=DG.CSS.dgDataTR_None;
}
_41.appendChild(oTr);
var _44=c.length;
for(var j=0;j<_44;j++){
var oTd=fdg_CreateElement("TD");
oTr.appendChild(oTd);
oTd.id="dgData_Td_"+_1+"_"+i+"_"+j;
oTd.style.width=c[j][0]+"px";
oTd.className=c[j][1];
oTd.title=(_43.title||[])[j]||"";
if(c[j][3]){
oTd.innerHTML="<nobr>"+_43.text[j]+"</nobr>";
}else{
if(c[j][2]){
var _47=fdg_CreateElement("DIV");
_47.id=oTd.id+"_div";
oTd.appendChild(_47);
if(_43.text[j]){
_47.className="btnS ico_"+_43.text[j];
_47.style.margin="2px";
}
if(_43.mailFlags){
switch(_43.mailFlags[j]){
case "P":
fdg_setMailPriorityImage(DG,_47,a.priority);
break;
case "A":
if(a[0]){
_47.className=DG.CSS.dgDataAttach;
_47.title=gLang.read.page["hasattach"];
}
break;
case "I":
fdg_setMailStatusImage(DG,_47,a[1]);
break;
case "V":
fdg_setMailVirusImage(DG,_47,a[11]);
break;
}
}
}
}
}
if(_43.mailFlags){
_40.readUrl=a[7];
_40.chkValue=a[9];
_40.chkName=a[10];
_40.status=a[1];
}else{
_40.chkValue=_43.id;
}
var _48=fdg_CreateElement("TD");
oTr.appendChild(_48);
_48.style.visibility="inherit";
DG.System.initDataEvent(_40);
if(!DG.System.isIE){
var btn=fdg_CreateElement("INPUT");
btn.type="button";
btn.style.position="absolute";
btn.style.left="-1000px";
btn.style.height="10px";
_40.rows[0].cells[0].appendChild(btn);
_40.focus=function(){
if(!btn.style.top){
btn.style.top=(El.getY(btn.parentNode)-El.getY(_40.parentNode))+"px";
}
this.rows[0].cells[0].lastChild.focus();
};
}
return _40;
}
function fdg_setMailPriorityImage(DG,_4b,_4c){
if(_4c<3){
_4b.className=DG.CSS.dgDataPriorityHigh;
_4b.title=gLang.read.page["urgent"];
}else{
if(_4c>3){
_4b.className=DG.CSS.dgDataPriorityLow;
_4b.title=gLang.read.page["slow"];
}else{
_4b.className="";
_4b.title="";
}
}
}
function fdg_setMailVirusImage(DG,_4e,_4f){
if(_4f){
_4e.className=DG.CSS["dgDataVirus_"+_4f]||"";
_4e.title=gLang.read.page["avs_"+_4f]||"";
}
}
function fdg_setMailStatusImage(DG,_51,_52){
switch(_52){
case 0:
_51.className=DG.CSS.dgDataStatusDraft;
break;
case 1:
_51.className=DG.CSS.dgDataStatusSched;
break;
case 2:
_51.className=DG.CSS.dgDataStatusTranReply;
break;
case 3:
_51.className=DG.CSS.dgDataStatusReply;
break;
case 4:
_51.className=DG.CSS.dgDataStatusTrans;
break;
case 5:
_51.className=DG.CSS.dgDataStatusNewMail;
break;
case 6:
_51.className=DG.CSS.dgDataStatusReaded;
break;
}
}
function fdg_InitContainerEvent(obj){
var DG=this.DG;
obj.onclick=DG.HTML.Container.onClick;
}
function fdg_InitDataEvent(obj){
var DG=this.DG;
obj.ondblclick=DG.HTML.Data.onDblClick;
obj.onclick=DG.HTML.Data.onClick;
obj.oncontextmenu=DG.HTML.Data.onContextmenu;
obj.onmouseover=DG.HTML.Data.onMouseover;
obj.onmouseout=DG.HTML.Data.onMouseout;
obj.onmousedown=DG.HTML.Data.onMousedown;
obj.onmouseup=DG.HTML.Data.onMouseup;
obj.onmousemove=DG.HTML.Data.onMousemove;
obj.onkeydown=DG.HTML.Data.onKeydown;
obj.onkeypress=DG.HTML.Data.onKeypress;
obj.onkeyup=DG.HTML.Data.onKeyup;
}
var _57=false;
function fdg_InitEvent(){
if(!_57){
_57=true;
var obj=$doc().body;
Event.observe(obj,"mouseup",DG_HTML_Title_dragOnMouseup,true);
Event.observe(obj,"mousemove",DG_HTML_Title_dragOnMousemove,true);
}
}
function DG_HTML_Title_dragOnMouseup(e){
e=e||$win().event;
if(DG.HTML.Title.isDrag){
fdg_TitleDrag(DG,e);
DG.HTML.Title.isDrag=false;
}
fdg_RemoveChild(DG,DG.HTML.Title.dragDiv);
DG.HTML.Title.dragClientX=0;
DG.HTML.Title.dragDiv=null;
}
function DG_HTML_Title_dragOnMousemove(e){
e=e||$win().event;
if(!DG.HTML.Title.isDrag){
return;
}
var obj=DG.HTML.Title.dragDiv;
var l=parseInt(e.clientX,10)-fdg_GetX(fdg_GetDataContainer(DG));
if(l<0){
l=0;
}
obj.style.left=l+"px";
}
function fdg_HTMLInstance(DG){
DG.HTML={DG:DG};
DG.HTML.Object={};
DG.HTML.dgTitleNode=null;
DG.HTML.dgDataNode=null;
DG.HTML.SelectTargetArray=[];
DG.HTML.LastSelectTarget=null;
DG.HTML.Title=function(){
};
DG.HTML.Data=function(){
};
DG.HTML.Container=function(){
};
DG.HTML.Title.dragDiv=null;
DG.HTML.Title.dragObject=null;
DG.HTML.Title.dragClientX=0;
DG.HTML.Title.onClick=function(e){
e=e||$win().event;
fdg_TitleSort(DG,e);
(DG.HTML.Title.outOnClick||Prototype.emptyFunction)(e);
};
DG.HTML.Title.onDblClick=function(e){
e=e||$win().event;
fdg_TitleSort(DG,e);
(DG.HTML.Title.outOnDblClick||Prototype.emptyFunction)(e);
};
DG.HTML.Title.onContextmenu=function(e){
e=e||$win().event;
if(DG.HTML.Title.outOnContextmenu!=null){
DG.HTML.Title.outOnContextmenu(e);
return false;
}
};
DG.HTML.Title.dragOnMousedown=function(e){
e=e||$win().event;
var o=Event.element(e);
var _63=fdg_CreateElement("DIV");
_63.style.height=parseInt(DG.HTML.dgDataNode.clientHeight,10)>parseInt(DG.HTML.dgDataNode.parentNode.style.height,10)?DG.HTML.dgDataNode.clientHeight:DG.HTML.dgDataNode.parentNode.style.height;
_63.style.width="3px";
_63.style.position="relative";
_63.style.top="0px";
_63.style.left=parseInt(e.clientX,10)-fdg_GetX(fdg_GetDataContainer(DG))+"px";
_63.style.backgroundColor="#888888";
_63.style.zIndex=99;
fdg_AppendChild(DG,_63);
DG.HTML.Title.dragDiv=_63;
DG.HTML.Title.dragObject=o;
DG.HTML.Title.isDrag=true;
DG.HTML.Title.dragClientX=parseInt(e.clientX,10);
};
DG.HTML.Data.lastSystemKey="";
DG.HTML.Data.onMouseover=function(e){
(DG.HTML.Data.outOnMouseOver||Prototype.emptyFunction)(e||$win().event);
};
DG.HTML.Data.onMouseout=function(e){
(DG.HTML.Data.outOnMouseOut||Prototype.emptyFunction)(e||$win().event);
};
var _66;
DG.HTML.Data.onMousedown=function(e){
e=e||$win().event;
_66=1;
if(fIsSelected(DG,this)){
DG.HTML.LastSelectTarget=this;
}else{
fdg_DataSelectByMouse(DG,this,e);
_66=2;
}
(DG.HTML.Data.outOnMouseDown||Prototype.emptyFunction)(e);
};
DG.HTML.Data.onMouseup=function(e){
e=e||$win().event;
if(DG.HTML.Title.isDrag){
return;
}
if(_66==1&&Event.isLeftClick(e)){
fdg_DataSelectByMouse(DG,this,e);
}
_66=0;
(DG.HTML.Data.outOnMouseUp||Prototype.emptyFunction)(e);
};
DG.HTML.Data.onMousemove=function(e){
e=e||$win().event;
if(DG.HTML.SelectTargetArray.length==0){
return;
}
if(_66>0){
(DG.HTML.Data.outOnMouseMove||Prototype.emptyFunction)(e);
_66=2;
}
return false;
};
DG.HTML.Data.onKeydown=function(e){
e=e||$win().event;
fdg_DataOnKeyDown(DG,this,e);
};
DG.HTML.Container.onClick=function(e){
(DG.HTML.Container.outOnClick||Prototype.emptyFunction)(this,e||$win().event);
};
DG.HTML.Data.onClick=function(e){
e=e||$win().event;
(DG.HTML.Data.outOnClick||Prototype.emptyFunction)(e);
try{
this.focus();
}
catch(ex){
}
};
DG.HTML.Data.onDblClick=function(e){
fdg_DataDblClickHandleCommand(DG,this,e||$win().event);
};
DG.HTML.Data.onContextmenu=function(e){
e=e||$win().event;
if(DG.HTML.Data.outOnContextmenu!=null){
DG.HTML.Data.outOnContextmenu(e);
return false;
}
};
DG.HTML.Data.onKeypress=function(e){
(DG.HTML.Data.outOnKeyPress||Prototype.emptyFunction)(e||$win().event);
};
DG.HTML.Data.onKeyup=function(e){
(DG.HTML.Data.outOnKeyUp||Prototype.emptyFunction)(e||$win().event);
};
}
function fdg_DataSelectByMouse(DG,o,e){
while(o.tagName!="TABLE"){
o=o.parentNode;
}
var _74=DG.HTML.dgDataNode.childNodes;
var _75=_74.length;
if(e.shiftKey){
var _76=DG.HTML.LastSelectTarget;
var n=o.index;
var k=0;
var a=[];
var m;
if(_76!=null){
m=_76.index;
if(m>n){
for(var i=0;i<_75;i++){
k=_74[i].index;
if(k>=n&&k<=m){
fChangeSelectCss(DG,_74[i]);
a.add(_74[i]);
}else{
fChangeNoSelectCss(DG,_74[i]);
}
}
}else{
if(m<n){
for(var i=0;i<_75;i++){
k=_74[i].index;
if(k>=m&&k<=n){
fChangeSelectCss(DG,_74[i]);
a.add(_74[i]);
}else{
fChangeNoSelectCss(DG,_74[i]);
}
}
}
}
fChangeSelectCss(DG,o);
}else{
a=[o];
fChangeSelectToCss(DG,o);
}
DG.HTML.LastSelectTarget=o;
DG.HTML.SelectTargetArray=a;
DG.HTML.Data.lastSystemKey="shift";
}else{
if(e.ctrlKey){
var _7c=DG.HTML.SelectTargetArray;
var k="";
var b=[];
var s="";
var a=[];
var _7f=false;
var _80=0;
if(_7c!=null){
_80=_7c.length;
}
for(var i=0;i<_80;i++){
b[b.length]=_7c[i].index;
if(o==_7c[i]){
_7f=true;
}else{
a[a.length]=_7c[i];
}
}
if(_7f){
DG.HTML.SelectTargetArray=a;
}else{
if(DG.HTML.SelectTargetArray==null){
var x=[];
x[0]=o;
DG.HTML.SelectTargetArray=x;
}else{
DG.HTML.SelectTargetArray[a.length]=o;
}
}
s="-"+b.join("-")+"-";
for(var i=0;i<_75;i++){
k="-"+_74[i].index+"-";
if(s.indexOf(k)>-1){
}else{
fChangeNoSelectCss(DG,_74[i]);
}
}
if(DG.HTML.SelectTargetArray.length>0){
fChangeSelectToCss(DG,o);
}else{
DG.HTML.SelectTargetArray=[o];
fChangeSelectCss(DG,o);
}
DG.HTML.LastSelectTarget=o;
DG.HTML.Data.lastSystemKey="ctrl";
}else{
for(var i=0;i<_75;i++){
fChangeNoSelectCss(DG,_74[i]);
}
fChangeSelectToCss(DG,o);
DG.HTML.SelectTargetArray=[o];
DG.HTML.LastSelectTarget=o;
DG.HTML.Data.lastSystemKey="";
}
}
fSelectionChanged(DG);
}
function fdg_DataOnKeyDown(DG,o,e){
while(o.tagName!="TABLE"){
o=o.parentNode;
}
var oTr=o.childNodes[0].childNodes[0];
var kc=e.keyCode;
if(kc==9){
DG.HTML.onBlurHTMLObject(e);
return;
}
var _87=DG.HTML.dgDataNode.childNodes;
var _88=DG.HTML.SelectTargetArray;
var _89=_87.length;
var _8a=0;
if(kc==33||kc==34){
try{
var _8b=DG.CSS.dgDataRowHeight;
var _8c="";
_8c=DG.HTML.dgDataNode.parentNode.style.height;
_8c=parseInt(_8c.toLowerCase().replace(/px/ig,""));
_8a=Math.round(_8c/_8b);
}
catch(e){
}
}
if(e.shiftKey){
switch(kc){
case 33:
if(DG.HTML.LastSelectTarget!=null){
var len=_88.length;
var k=DG.HTML.LastSelectTarget.index;
var a=[];
var m=0;
var n=0;
m=_89-k;
var _92=true;
if(DG.HTML.Data.lastSystemKey=="shift"){
if(DG.HTML.LastSelectTarget==_88[len-1]){
_92=false;
n=_89-_88[0].index-_8a;
}else{
n=m-_8a;
}
}else{
n=m-_8a;
}
if(n<0){
n=0;
}
if(_92){
for(var i=0;i<len;i++){
fChangeNoSelectCss(DG,_88[i]);
}
}
for(var i=n;i<m;i++){
a[a.length]=_87[i];
fChangeSelectCss(DG,_87[i],true);
}
DG.HTML.SelectTargetArray=a;
}
break;
case 34:
if(DG.HTML.LastSelectTarget!=null){
var len=_88.length;
var k=DG.HTML.LastSelectTarget.index;
var a=[];
var m=0;
var n=0;
m=_89-k-1;
var _92=true;
if(DG.HTML.Data.lastSystemKey=="shift"){
if(DG.HTML.LastSelectTarget==_88[0]){
_92=false;
n=_89-_88[len-1].index+1+_8a;
}else{
n=m+_8a;
}
}else{
n=m+_8a;
}
if(n>_89){
n=_89;
}
if(_92){
for(var i=0;i<len;i++){
fChangeNoSelectCss(DG,_88[i]);
}
}
for(var i=m;i<n;i++){
a[a.length]=_87[i];
fChangeSelectCss(DG,_87[i],true);
}
DG.HTML.SelectTargetArray=a;
}
break;
case 36:
if(DG.HTML.LastSelectTarget!=null){
var len=_88.length;
var k=DG.HTML.LastSelectTarget.index;
var a=[];
for(var i=0;i<len;i++){
fChangeNoSelectCss(DG,_88[i]);
}
k=_89-k;
for(var i=0;i<k;i++){
a[i]=_87[i];
fChangeSelectCss(DG,_87[i],true);
}
DG.HTML.SelectTargetArray=a;
}
break;
case 35:
if(DG.HTML.LastSelectTarget!=null){
var len=_88.length;
var k=DG.HTML.LastSelectTarget.index;
var a=[];
for(var i=0;i<len;i++){
fChangeNoSelectCss(DG,_88[i]);
}
k=_89-k;
for(var i=k;i<_89;i++){
a[a.length]=_87[i];
fChangeSelectCss(DG,_87[i],true);
}
DG.HTML.SelectTargetArray=a;
}
break;
case 38:
if(DG.HTML.LastSelectTarget!=null){
var len=_88.length;
var k=DG.HTML.LastSelectTarget.index;
var m=0;
var a=[];
if(DG.HTML.Data.lastSystemKey=="shift"){
if(DG.HTML.LastSelectTarget==_88[0]){
m=_88[len-1].index;
if(m<k){
var b=[];
var n=_89-m-1;
for(var i=0;i<len;i++){
if(_87[n]==_88[i]){
fChangeNoSelectCss(DG,_88[i]);
}else{
b[b.length]=_88[i];
}
}
DG.HTML.SelectTargetArray=b;
}else{
var n=_89-m-2;
if(n<0){
n=0;
}
fChangeSelectCss(DG,_87[n],true);
a[0]=_87[n];
for(var i=0;i<len;i++){
a[i+1]=_88[i];
}
DG.HTML.SelectTargetArray=a;
}
}else{
if(DG.HTML.LastSelectTarget==_88[len-1]){
m=_88[0].index;
var n=_89-m-2;
if(n<0){
n=0;
}
fChangeSelectCss(DG,_87[n],true);
a[0]=_87[n];
for(var i=0;i<len;i++){
a[i+1]=_88[i];
}
DG.HTML.SelectTargetArray=a;
}
}
}else{
if(DG.HTML.Data.lastSystemKey=="ctrl"){
for(var i=0;i<len;i++){
if(o!=_88[i]){
fChangeNoSelectCss(DG,_88[i]);
}
}
a[0]=_87[_89-k-2];
a[1]=o;
fChangeSelectCss(DG,_87[_89-k-2],true);
DG.HTML.SelectTargetArray=a;
}else{
var n=_89-k-2;
if(n<0){
n=0;
}
fChangeSelectCss(DG,_87[n],true);
a[0]=_87[n];
a[1]=DG.HTML.SelectTargetArray[0];
DG.HTML.SelectTargetArray=a;
}
}
DG.HTML.Data.lastSystemKey="shift";
fSelectionChanged(DG);
return false;
}
break;
case 40:
if(DG.HTML.LastSelectTarget!=null){
var len=_88.length;
var k=DG.HTML.LastSelectTarget.index;
var m=0;
var a=[];
if(DG.HTML.Data.lastSystemKey=="shift"){
if(DG.HTML.LastSelectTarget==_88[0]){
m=_88[len-1].index;
var n=_89-m;
if(n>=_89){
n=_89-1;
}
fChangeSelectCss(DG,_87[n],true);
DG.HTML.SelectTargetArray[DG.HTML.SelectTargetArray.length]=_87[n];
}else{
if(DG.HTML.LastSelectTarget==_88[len-1]){
m=_88[0].index;
if(m>k){
var b=[];
var n=_89-m-1;
for(var i=0;i<len;i++){
if(_87[n]==_88[i]){
fChangeNoSelectCss(DG,_88[i]);
}else{
b[b.length]=_88[i];
}
}
DG.HTML.SelectTargetArray=b;
}else{
fChangeSelectCss(DG,_87[m+1],true);
DG.HTML.SelectTargetArray[DG.HTML.SelectTargetArray.length]=_87[m+1];
}
}
}
}else{
if(DG.HTML.Data.lastSystemKey=="ctrl"){
for(var i=0;i<len;i++){
if(o!=_88[i]){
fChangeNoSelectCss(DG,_88[i]);
}
}
a[0]=o;
a[1]=_87[_89-k];
fChangeSelectCss(DG,_87[_89-k],true);
DG.HTML.SelectTargetArray=a;
}else{
var n=_89-k;
if(n>=_89){
n=_89-1;
}
fChangeSelectCss(DG,_87[n],true);
DG.HTML.SelectTargetArray[DG.HTML.SelectTargetArray.length]=_87[n];
}
}
DG.HTML.Data.lastSystemKey="shift";
fSelectionChanged(DG);
return false;
}
break;
default:
break;
}
fdg_DataKeyDownHandleCommand(DG,o,e);
DG.HTML.Data.lastSystemKey="shift";
}else{
if(e.ctrlKey){
if(kc==65){
DG.selectAll(true);
Event.stop(e);
}else{
if(kc==36){
CM[DG.parentModule.moduleName].absolute(0);
Event.stop(e);
}else{
if(kc==35){
CM[DG.parentModule.moduleName].absolute(-1);
Event.stop(e);
}
}
}
fdg_DataKeyDownHandleCommand(DG,o,e);
DG.HTML.Data.lastSystemKey="ctrl";
}else{
switch(kc){
case 33:
var k=DG.HTML.LastSelectTarget.index;
if(k<_8a-1&&k>=0){
k=_8a;
}else{
k=k+_8a;
}
k=_89-k;
if(k<0){
k=0;
}
for(var i=0;i<_89;i++){
fChangeNoSelectCss(DG,_87[i]);
}
var a=[];
a[0]=_87[k];
fChangeSelectCss(DG,_87[k],true);
DG.HTML.SelectTargetArray=a;
DG.HTML.LastSelectTarget=_87[k];
break;
case 34:
var k=DG.HTML.LastSelectTarget.index;
if(k<_89&&k>_89-_8a){
k=_89-_8a;
}else{
k=k-_8a;
}
k=_89-k-1;
if(k>_89-1){
k=_89-1;
}
for(var i=0;i<_89;i++){
fChangeNoSelectCss(DG,_87[i]);
}
var a=[];
a[0]=_87[k];
fChangeSelectCss(DG,_87[k],true);
DG.HTML.SelectTargetArray=a;
DG.HTML.LastSelectTarget=_87[k];
break;
case 36:
for(var i=0;i<_89;i++){
fChangeNoSelectCss(DG,_87[i]);
}
var a=[];
a[0]=_87[0];
fChangeSelectCss(DG,_87[0],true);
DG.HTML.SelectTargetArray=a;
DG.HTML.LastSelectTarget=_87[0];
break;
case 35:
for(var i=0;i<_89;i++){
fChangeNoSelectCss(DG,_87[i]);
}
var a=[];
a[0]=_87[_89-1];
fChangeSelectCss(DG,_87[_89-1],true);
DG.HTML.SelectTargetArray=a;
DG.HTML.LastSelectTarget=_87[_89-1];
break;
case 38:
if(DG.HTML.LastSelectTarget!=null){
var len=_88.length;
var k=DG.HTML.LastSelectTarget.index;
if(DG.HTML.Data.lastSystemKey=="shift"){
if(DG.HTML.LastSelectTarget==_88[0]){
k=_88[len-1].index;
}else{
if(DG.HTML.LastSelectTarget==_88[len-1]){
k=_88[0].index;
}
}
}
for(var i=0;i<len;i++){
fChangeNoSelectCss(DG,_88[i]);
}
k=_89-k-2;
if(k<0){
if(CM[DG.parentModule.moduleName].hasPrePage()){
CM[DG.parentModule.moduleName].relativePage(-1,-1);
return;
}else{
k=0;
}
}
var a=[];
a[0]=_87[k];
fChangeSelectCss(DG,_87[k],true);
DG.HTML.SelectTargetArray=a;
DG.HTML.LastSelectTarget=_87[k];
}
break;
case 40:
if(DG.HTML.LastSelectTarget!=null){
var len=_88.length;
var k=DG.HTML.LastSelectTarget.index;
if(DG.HTML.Data.lastSystemKey=="shift"){
if(DG.HTML.LastSelectTarget==_88[0]){
k=_88[len-1].index;
}else{
if(DG.HTML.LastSelectTarget==_88[len-1]){
k=_88[0].index;
}
}
}
k=_89-k;
if(k>=_89){
if(CM[DG.parentModule.moduleName].hasNextPage()){
CM[DG.parentModule.moduleName].relativePage(1,0);
return;
}else{
k=_89-1;
}
}
for(var i=0;i<len;i++){
fChangeNoSelectCss(DG,_88[i]);
}
var a=[];
a[0]=_87[k];
fChangeSelectCss(DG,_87[k],true);
DG.HTML.SelectTargetArray=a;
DG.HTML.LastSelectTarget=_87[k];
}
break;
default:
break;
}
DG.HTML.Data.lastSystemKey="";
fSelectionChanged(DG);
fdg_DataKeyDownHandleCommand(DG,o,e);
if(kc==38||kc==40){
return false;
}
}
}
}
function fdg_DataDblClickHandleCommand(DG,o,ev){
var _98=DG.parentModule.moduleName;
var _99=ev.altKey?"properties":"open";
Event.stop(ev);
setTimeout("MM['"+_98+"'].operate('"+_99+"')");
(DG.HTML.Data.outOnDblClick||Prototype.emptyFunction)(ev);
}
function fdg_DataKeyDownHandleCommand(DG,o,ev){
if(!DG.parentModule){
return;
}
var _9d=DG.parentModule.moduleName;
var _9e;
switch(ev.keyCode){
case 16:
case 17:
case 18:
return;
case 13:
_9e=ev.altKey?"properties":"open";
break;
case 46:
if(!ev.altKey&&!ev.ctrlKey){
_9e=ev.shiftKey?"reldel":"del";
}
break;
case 33:
case 34:
case 35:
case 36:
case 38:
case 40:
if(!ev.altKey&&!ev.ctrlKey&&!ev.shiftKey){
_9e="preview";
}
break;
case 113:
if(!ev.altKey&&!ev.ctrlKey&&!ev.shiftKey){
_9e="rename";
}
break;
}
if(_9e){
Event.stop(ev);
setTimeout("MM['"+_9d+"'].operate('"+_9e+"')");
}
(DG.HTML.Data.outOnKeyDown||Prototype.emptyFunction)(ev);
}
function fSelectAll(_9f){
var DG=this;
var _a1=$A(DG.HTML.dgDataNode.childNodes);
_a1.each((_9f?fChangeSelectCss:fChangeNoSelectCss).bind(null,DG));
DG.HTML.SelectTargetArray=_9f?_a1:[];
if(!_9f){
DG.HTML.LastSelectTarget=null;
}
fSelectionChanged(DG);
}
function fIsSelected(DG,tab){
return DG.HTML.SelectTargetArray.include(tab);
}
function fChangeNoSelectCss(DG,tab){
var oTr=tab.firstChild.firstChild;
switch(oTr.className){
case DG.CSS.dgDataTR_Select:
oTr.className=DG.CSS.dgDataTR_None;
break;
case DG.CSS.dgDataTR_SelectLost:
oTr.className=DG.CSS.dgDataTR_None;
break;
case DG.CSS.dgDataTR_NewSelect:
oTr.className=DG.CSS.dgDataTR_New;
break;
case DG.CSS.dgDataTR_NewSelectLost:
oTr.className=DG.CSS.dgDataTR_New;
break;
default:
break;
}
}
function fChangeSelectCss(DG,tab,_a9){
var oTr=tab.firstChild.firstChild;
switch(oTr.className){
case DG.CSS.dgDataTR_None:
oTr.className=DG.CSS.dgDataTR_Select;
break;
case DG.CSS.dgDataTR_SelectLost:
oTr.className=DG.CSS.dgDataTR_Select;
break;
case DG.CSS.dgDataTR_New:
oTr.className=DG.CSS.dgDataTR_NewSelect;
break;
case DG.CSS.dgDataTR_NewSelectLost:
oTr.className=DG.CSS.dgDataTR_NewSelect;
break;
default:
break;
}
if(tab.scrollIntoView&&_a9){
var _ab=DG.HTML.getElementByID("dgData_"+_1);
if(tab.offsetTop<_ab.scrollTop){
_ab.scrollTop=tab.offsetTop;
}else{
if(tab.offsetTop+tab.offsetHeight>_ab.scrollTop+_ab.offsetHeight){
_ab.scrollTop=tab.offsetTop+tab.offsetHeight-_ab.offsetHeight;
}
}
}
}
function fChangeSelectToCss(DG,tab){
var oTr=tab.firstChild.firstChild;
switch(oTr.className){
case DG.CSS.dgDataTR_None:
oTr.className=DG.CSS.dgDataTR_Select;
break;
case DG.CSS.dgDataTR_Select:
oTr.className=DG.CSS.dgDataTR_None;
break;
case DG.CSS.dgDataTR_SelectLost:
oTr.className=DG.CSS.dgDataTR_Select;
break;
case DG.CSS.dgDataTR_New:
oTr.className=DG.CSS.dgDataTR_NewSelect;
break;
case DG.CSS.dgDataTR_NewSelect:
oTr.className=DG.CSS.dgDataTR_New;
break;
case DG.CSS.dgDataTR_NewSelectLost:
oTr.className=DG.CSS.dgDataTR_NewSelect;
break;
default:
break;
}
}
function fChangeLostFocusCss(DG,tab){
var oTr=tab.firstChild.firstChild;
switch(oTr.className){
case DG.CSS.dgDataTR_Select:
oTr.className=DG.CSS.dgDataTR_SelectLost;
break;
case DG.CSS.dgDataTR_NewSelect:
oTr.className=DG.CSS.dgDataTR_NewSelectLost;
break;
default:
break;
}
}
function fdg_ChangeToNewCss(DG,oTr){
switch(oTr.className){
case DG.CSS.dgDataTR_None:
oTr.className=DG.CSS.dgDataTR_New;
break;
case DG.CSS.dgDataTR_Select:
oTr.className=DG.CSS.dgDataTR_NewSelect;
break;
case DG.CSS.dgDataTR_SelectLost:
oTr.className=DG.CSS.dgDataTR_NewSelectLost;
break;
}
}
function fdg_ChangeToNoNewCss(DG,oTr){
switch(oTr.className){
case DG.CSS.dgDataTR_New:
oTr.className=DG.CSS.dgDataTR_None;
break;
case DG.CSS.dgDataTR_NewSelect:
oTr.className=DG.CSS.dgDataTR_Select;
break;
case DG.CSS.dgDataTR_NewSelectLost:
oTr.className=DG.CSS.dgDataTR_SelectLost;
break;
}
}
function fdg_TitleSort(DG,e){
var _b8=DG.System.sortColumn;
var _b9=DG.System.sortBy;
var obj=Event.element(e);
var d=DG.System.data;
var _bc=false;
if(d==null){
return;
}
var _bd=DG.parentModule.moduleName;
var sX=obj.id;
if(sX.indexOf("dgTitle1obj_")<0){
sX=obj.parentNode.id;
obj=obj.parentNode;
}
sX+="_";
var _bf=sX.split("_");
var sID=_bf[0]+"_"+_bf[1]+"_"+_b8+"_"+_bf[3];
var _c1=DG.HTML.getElementByID(sID);
var k=obj.index;
if(_b8==k){
if(_b9==DG.CSS.dgTitleDownHTML){
DG.System.sortBy=DG.CSS.dgTitleUpHTML;
}else{
DG.System.sortBy=DG.CSS.dgTitleDownHTML;
}
}else{
DG.System.sortColumn=k;
DG.System.sortBy=DG.CSS.dgTitleDownHTML;
}
if(_c1!=null&&obj.displayArrow&&_c1.lastChild&&_c1.lastChild.className&&_c1.lastChild.className.indexOf("msgIcon")>=0){
_c1.removeChild(_c1.lastChild);
}
if(obj.displayArrow){
obj.innerHTML+=DG.System.sortBy;
}
var _c3=[];
DG.System.setData(_c3);
DG.refresh();
MM[_bd].sOrderby=obj.isSort;
MM[_bd].boDesc=(DG.System.sortBy==DG.CSS.dgTitleDownHTML);
MM[_bd].nPageStart=0;
MM[_bd].refresh();
}
function fdg_TitleDrag(DG,ev){
var _c6=DG.HTML.Title.dragObject;
var _c7=DG.CSS.titleCSS;
var _c8=DG.CSS.dataCSS;
var len=_c7.length;
var k=_c6.index;
var m=parseInt(ev.clientX,10);
var _cc=DG.HTML.Title.dragClientX-m;
var l=fdg_GetX(fdg_GetDataContainer(DG))+parseInt(_c7[k][0],10)+20;
if(l>m){
return;
}
var _ce=DG.HTML.dgTitleNode.childNodes;
var _cf=DG.HTML.dgDataNode.childNodes;
var _d0=_ce.length;
var _d1=_cf.length;
for(var i=0;i<len;i++){
if(i==k){
_c7[i][1]=_c7[i][1]-_cc;
_c7[i][2]=_c7[i][2]-_cc;
_c8[i][0]=_c8[i][0]-_cc;
for(var j=0;j<_d1;j++){
_cf[j].childNodes[0].childNodes[0].childNodes[i].style.width=_c8[i][0];
}
for(var j=0;j<_d0;j++){
if(_ce[j].index==i){
if(_ce[j].id.indexOf("dgTitle1obj_")>-1){
_ce[j].style.left=_c7[i][0];
_ce[j].style.width=_c7[i][1];
}
if(_ce[j].id.indexOf("dgDrag2obj_")>-1){
_ce[j].style.left=_c7[i][2];
}
}
}
}else{
if(i>k){
_c7[i][0]=_c7[i][0]-_cc;
_c7[i][2]=_c7[i][2]-_cc;
for(var j=0;j<_d0;j++){
if(_ce[j].index==i){
if(_ce[j].id.indexOf("dgTitle1obj_")>-1){
_ce[j].style.left=_c7[i][0];
_ce[j].style.width=_c7[i][1];
}
if(_ce[j].id.indexOf("dgDrag2obj_")>-1){
_ce[j].style.left=_c7[i][2];
}
}
}
}
}
}
if(DG.cookiePrefix){
var _d4="";
var _d5="";
for(var i=0;i<len;i++){
_d4+=_c7[i][0]+","+_c7[i][1]+","+_c7[i][2]+",;";
_d5+=_c8[i][0]+";";
}
CC.setCookie(DG.cookiePrefix+"titlecss","");
CC.setCookie(DG.cookiePrefix+"datacss","");
}
}
function fdg_CreateHTMLObject(){
var DG=this.DG;
_1++;
var o=fdg_CreateElement("DIV");
o.id="dg_"+_1;
DG.HTML.Object=o;
var oT=fdg_CreateElement("DIV");
oT.id="dgTitle_"+_1;
oT.className=DG.CSS.dgTitleDiv;
DG.HTML.dgTitleNode=oT;
var oD=fdg_CreateElement("DIV");
oD.id="dgData_"+_1;
oD.className=DG.CSS.dgDataDiv;
oD.style.width=DG.CSS.dgDataDivWidth;
oD.style.height=DG.CSS.dgDataDivHeight+"px";
oD.style.visibility=DG.CSS.dgDataDivVisibility;
var oD2=fdg_CreateElement("DIV");
oD2.className=DG.CSS.dgDataDiv2;
oD.appendChild(oD2);
DG.HTML.dgDataNode=oD2;
DG.HTML.dgDataContainer=oD;
DG.HTML.Object.appendChild(oT);
DG.HTML.Object.appendChild(oD);
}
function fdg_OnBlurHTMLObject(){
var DG=this.DG;
var _dc=DG.HTML.SelectTargetArray;
var len=_dc.length;
for(var i=0;i<len;i++){
fChangeLostFocusCss(DG,_dc[i]);
}
}
function fdg_OnFocusHTMLObject(){
var DG=this.DG;
DG.focus();
}
function fdg_SetLastSelectFocus(_e0){
var DG=this.DG;
var _e2=DG.HTML.dgDataNode.childNodes;
if(_e0>_e2.length){
_e0=_e2.length-1;
}
DG.HTML.SelectTargetArray.each(fChangeNoSelectCss.bind(null,DG));
var _e3=(_e0>=0)&&_e2[_e0];
if(_e3){
fChangeSelectCss(DG,_e3,true);
DG.HTML.SelectTargetArray=[_e3];
DG.HTML.LastSelectTarget=_e3;
if(_e3.offsetWidth){
_e3.focus();
}
}else{
DG.HTML.SelectTargetArray=[];
DG.HTML.LastSelectTarget=null;
}
fSelectionChanged(DG);
}
function fdg_ChangeDataCellValue(x){
var DG=this.DG;
var _e6=DG.System.data;
if(_e6==null||x<0||x>_e6.length-1){
return;
}
var a=_e6[x];
var _e8=DG.getDataSpec(a);
var _e9=DG.HTML.dgDataNode.childNodes;
var oTr=_e9[x].childNodes[0].childNodes[0];
for(var j=0;j<_e8.mailFlags.length;j++){
var _ec=oTr.childNodes[j].childNodes[0];
switch(_e8.mailFlags[j]){
case "P":
fdg_setMailPriorityImage(DG,_ec,a.priority);
break;
case "I":
fdg_setMailStatusImage(DG,_ec,a[1]);
break;
}
}
if(_e8.isNew){
fdg_ChangeToNewCss(DG,oTr);
}else{
fdg_ChangeToNoNewCss(DG,oTr);
}
}
function fdg_SetTitleOnClick(_ed){
var DG=this.DG;
DG.HTML.Title.outOnClick=_ed;
}
function fdg_SetTitleOnDblClick(_ef){
var DG=this.DG;
DG.HTML.Title.outOnDblClick=_ef;
}
function fdg_SetTitleOnContextmenu(_f1){
var DG=this.DG;
DG.HTML.Title.outOnContextmenu=_f1;
}
function fdg_SetContainerOnClick(_f3){
var DG=this.DG;
DG.HTML.Container.outOnClick=_f3;
}
function fdg_SetDataOnClick(_f5){
var DG=this.DG;
DG.HTML.Data.outOnClick=_f5;
}
function fdg_SetDataOnDblClick(_f7){
var DG=this.DG;
DG.HTML.Data.outOnDblClick=_f7;
}
function fdg_SetDataOnContextmenu(_f9){
var DG=this.DG;
DG.HTML.Data.outOnContextmenu=_f9;
}
function fdg_SetDataOnMouseOver(_fb){
var DG=this.DG;
DG.HTML.Data.outOnMouseOver=_fb;
}
function fdg_SetDataOnMouseOut(_fd){
var DG=this.DG;
DG.HTML.Data.outOnMouseOut=_fd;
}
function fdg_SetDataOnMouseDown(_ff){
var DG=this.DG;
DG.HTML.Data.outOnMouseDown=_ff;
}
function fdg_SetDataOnMouseUp(func){
var DG=this.DG;
DG.HTML.Data.outOnMouseUp=func;
}
function fdg_SetDataOnMouseDrag(func){
var DG=this.DG;
DG.HTML.Data.outOnMouseMove=func;
}
function fdg_SetDataOnKeyDown(func){
var DG=this.DG;
DG.HTML.Data.outOnKeyDown=func;
}
function fdg_SetDataOnKeyPress(func){
var DG=this.DG;
DG.HTML.Data.outOnKeyPress=func;
}
function fdg_SetDataOnKeyUp(func){
var DG=this.DG;
DG.HTML.Data.outOnKeyUp=func;
}
function fdg_GetLastSelectTarget(){
var DG=this.DG;
return DG.HTML.LastSelectTarget;
}
function fdg_GetSelectTargetArray(){
var DG=this.DG;
return DG.HTML.SelectTargetArray;
}
function fdg_GetObjectByID(id){
if(id!=""){
return fdg_GetElementById(id);
}else{
return null;
}
}
function fdg_SetTitleCss(_10e){
var DG=this.DG;
if(_10e){
DG.CSS.titleCSS=_10e;
if(!DG.cookiePrefix){
return;
}
var _110=CC.getCookie(DG.cookiePrefix+"titlecss");
if(!_110){
return;
}
var aTC=_110.split(";");
var len=aTC.length-1;
for(var i=0;i<len;i++){
var aT=aTC[i].split(",");
DG.CSS.titleCSS[i][0]=aT[0];
DG.CSS.titleCSS[i][1]=aT[1];
DG.CSS.titleCSS[i][2]=aT[2];
}
}
}
function fdg_GetTitleCss(){
var DG=this.DG;
return DG.CSS.titleCSS;
}
function fdg_SetDataCss(_116){
var DG=this.DG;
if(_116){
DG.CSS.dataCSS=_116;
if(!DG.cookiePrefix){
return;
}
var _118=CC.getCookie(DG.cookiePrefix+"datacss");
if(!_118){
return;
}
var aDC=_118.split(";");
var len=aDC.length-1;
for(var i=0;i<len;i++){
DG.CSS.dataCSS[i][0]=aDC[i];
}
}
}
function fdg_GetDataCss(){
var DG=this.DG;
return DG.CSS.dataCSS;
}
function fdg_CreateElement(tag){
return $doc().createElement(tag);
}
function fdg_GetElementById(id){
return $doc().getElementById(id);
}
function fdg_AppendChildBody(obj){
$doc().body.appendChild(obj);
}
function fdg_GetX(e){
var l=e.offsetLeft;
while(e=e.offsetParent){
l+=e.offsetLeft;
}
return l;
}
function fdg_AppendChild(DG,obj){
fdg_GetDataContainer(DG).appendChild(obj);
}
function fdg_RemoveChild(DG,obj){
try{
fdg_GetDataContainer(DG).removeChild(obj);
}
catch(ex){
}
}
function fdg_GetDataContainer(DG){
return DG.HTML.dgDataContainer;
}
function fSelectionChanged(DG){
if(DG.parentModule){
MM.showToolbar(DG.parentModule.moduleName);
}
}
})();

var DatePicker={};
(function(){
DatePicker.initDatePickers=initDatePickers;
Calendar.NUM_DAYS=[0,31,59,90,120,151,181,212,243,273,304,334];
Calendar.LEAP_NUM_DAYS=[0,31,60,91,121,152,182,213,244,274,305,335];
var _1=String.fromCharCode(160);
Calendar.prototype._bw=new bw_check();
Calendar.prototype._yearBeforeMonth=false;
Calendar.prototype._firstDayOfWeek=0;
Calendar.prototype._minimalDaysInFirstWeek=4;
Calendar.prototype._monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];
Calendar.prototype._shortMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
Calendar.prototype._weekDayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
Calendar.prototype._shortWeekDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
Calendar.prototype._tinyWeekDayNames=["Su","Mo","Tu","We","Th","Fr","Sa"];
Calendar.prototype._weekNumberHead=_1+"w"+_1;
Calendar.prototype._weekDayHeads=Calendar.prototype._tinyWeekDayNames;
Calendar.prototype._todayButtonFormat="EEE, dd MMM yyyy";
Calendar.prototype._clearButtonText="Clear";
Calendar.prototype._format="yyyy-MM-dd";
function Calendar(_2){
if(arguments.length==0){
this._currentDate=new Date();
this._selectedDate=null;
}else{
this._currentDate=new Date(_2);
this._selectedDate=new Date(_2);
}
this._showing=false;
this._includeWeek=false;
this._hideOnSelect=true;
this._alwaysVisible=false;
this._dateSlot=new Array(42);
this._weekSlot=new Array(6);
this._calDiv=null;
}
Calendar.prototype.create=function(){
var _3;
var _4;
var _5;
var tr;
var td;
var dp=this;
this._calDiv=$doc().createElement("div");
this._calDiv.className="calendar";
this._calDiv.style.position="absolute";
this._calDiv.style.display="none";
this._calDiv.style.zIndex="400";
_3=$doc().createElement("div");
_3.className="calendarHeader";
this._calDiv.appendChild(_3);
_4=$doc().createElement("table");
_3.appendChild(_4);
_5=$doc().createElement("tbody");
_4.appendChild(_5);
tr=$doc().createElement("tr");
_5.appendChild(tr);
td=$doc().createElement("td");
this._previousMonth=$doc().createElement("button");
this._previousMonth.className="prevMonthButton";
this._previousMonth.appendChild($doc().createTextNode("<"));
td.appendChild(this._previousMonth);
tr.appendChild(td);
td=$doc().createElement("td");
td.className="labelContainer";
this._monthSelect=$doc().createElement("select");
for(var i=0;i<this._monthNames.length;i++){
var _a=$doc().createElement("option");
_a.innerHTML=this._monthNames[i];
_a.value=i;
if(i==this._currentDate.getMonth()){
_a.selected=true;
}
this._monthSelect.appendChild(_a);
}
td.appendChild(this._monthSelect);
td=$doc().createElement("td");
td.className="labelContainer";
this._yearSelect=$doc().createElement("select");
for(var i=1920;i<2050;++i){
var _a=$doc().createElement("option");
_a.innerHTML=i;
_a.value=i;
if(i==this._currentDate.getFullYear()){
_a.selected=false;
}
this._yearSelect.appendChild(_a);
}
td.appendChild(this._yearSelect);
if(this._yearBeforeMonth){
tr.appendChild(this._yearSelect.parentNode);
tr.appendChild(this._monthSelect.parentNode);
}else{
tr.appendChild(this._monthSelect.parentNode);
tr.appendChild(this._yearSelect.parentNode);
}
td=$doc().createElement("td");
this._nextMonth=$doc().createElement("button");
this._nextMonth.appendChild($doc().createTextNode(">"));
this._nextMonth.className="nextMonthButton";
td.appendChild(this._nextMonth);
tr.appendChild(td);
_3=$doc().createElement("div");
_3.className="calendarBody";
this._calDiv.appendChild(_3);
this._table=_3;
var _b;
_4=$doc().createElement("table");
_4.className="grid";
_4.cellPadding="0";
_4.cellSpacing="0";
_3.appendChild(_4);
var _c=$doc().createElement("thead");
_4.appendChild(_c);
tr=$doc().createElement("tr");
_c.appendChild(tr);
if(this._includeWeek){
td=$doc().createElement("th");
_b=$doc().createTextNode(this._weekNumberHead);
td.appendChild(_b);
td.className="weekNumberHead";
tr.appendChild(td);
}
for(i=0;i<7;++i){
var _d=(i+this._firstDayOfWeek)%7;
td=$doc().createElement("th");
_b=$doc().createTextNode(this._weekDayHeads[_d]);
td.appendChild(_b);
td.className="weekDayHead";
if(_d==0){
td.className+=" sunday";
}
if(_d==6){
td.className+=" saturday";
}
tr.appendChild(td);
}
_5=$doc().createElement("tbody");
_4.appendChild(_5);
for(week=0;week<6;++week){
tr=$doc().createElement("tr");
_5.appendChild(tr);
if(this._includeWeek){
td=$doc().createElement("td");
td.className="weekNumber";
_b=$doc().createTextNode(_1);
td.appendChild(_b);
td.align="center";
tr.appendChild(td);
var _e=new Object();
_e.tag="WEEK";
_e.value=-1;
_e.data=_b;
this._weekSlot[week]=_e;
}
for(day=0;day<7;++day){
td=$doc().createElement("td");
var a=$doc().createElement("a");
a.href="#";
_b=$doc().createTextNode(_1);
a.appendChild(_b);
td.appendChild(a);
tr.appendChild(td);
var _e=new Object();
_e.tag="DATE";
_e.value=-1;
_e.data=a;
this._dateSlot[(week*7)+day]=_e;
}
}
_3=$doc().createElement("div");
_3.className="calendarFooter";
this._calDiv.appendChild(_3);
_4=$doc().createElement("table");
_4.className="footerTable";
_4.cellSpacing=0;
_3.appendChild(_4);
_5=$doc().createElement("tbody");
_4.appendChild(_5);
tr=$doc().createElement("tr");
_5.appendChild(tr);
td=$doc().createElement("td");
this._todayButton=$doc().createElement("button");
this._todayButton.className="todayButton";
var _10=new Date();
var _11=this.formatDate(_10,this._todayButtonFormat);
this._todayButton.appendChild($doc().createTextNode(_11));
td.appendChild(this._todayButton);
tr.appendChild(td);
td=$doc().createElement("td");
this._clearButton=$doc().createElement("button");
this._clearButton.className="clearButton";
_11=this._clearButtonText;
this._clearButton.appendChild($doc().createTextNode(_11));
td.appendChild(this._clearButton);
tr.appendChild(td);
this._update();
this._updateHeader();
this._previousMonth.hideFocus=true;
this._nextMonth.hideFocus=true;
this._todayButton.hideFocus=true;
this._previousMonth.onclick=function(){
dp.prevMonth();
};
this._nextMonth.onclick=function(){
dp.nextMonth();
};
this._todayButton.onclick=function(){
dp.setSelectedDate(new Date());
dp.hide();
};
this._clearButton.onclick=function(){
dp.clearSelectedDate();
dp.hide();
};
this._calDiv.onselectstart=function(){
return false;
};
for(i=0;i<42;i++){
this._dateSlot[i].data.onclick=function(e){
var n=parseInt(this.firstChild.data,10);
var d=new Date(dp._currentDate);
var _15=this.parentNode.parentNode.sectionRowIndex;
if(_15==0&&n>20){
d.setMonth(d.getMonth()-1);
}
if(_15>=4&&n<20){
d.setMonth(d.getMonth()+1);
}
d.setDate(n);
dp.setSelectedDate(d);
if(!dp._alwaysVisible&&dp._hideOnSelect){
dp.hide();
}
return false;
};
}
this._calDiv.onkeydown=function(e){
if(e==null){
e=$win().event;
}
var kc=e.keyCode!=null?e.keyCode:e.charCode;
if(kc==13){
var d=new Date(dp._currentDate).valueOf();
dp.setSelectedDate(d);
if(!dp._alwaysVisible&&dp._hideOnSelect){
dp.hide();
}
return false;
}
if(kc<37||kc>40){
return true;
}
var d=new Date(dp._currentDate).valueOf();
if(kc==37){
d-=24*60*60*1000;
}else{
if(kc==39){
d+=24*60*60*1000;
}else{
if(kc==38){
d-=7*24*60*60*1000;
}else{
if(kc==40){
d+=7*24*60*60*1000;
}
}
}
}
dp.setCurrentDate(new Date(d));
return false;
};
this._calDiv.onmousewheel=function(e){
if(e==null){
e=$win().event;
}
if(getEventObject(e).onchange){
return;
}
var n=-e.wheelDelta/120;
var d=new Date(dp._currentDate);
var m=d.getMonth()+n;
d.setMonth(m);
dp.setCurrentDate(d);
return false;
};
this._monthSelect.onchange=function(e){
if(e==null){
e=$win().event;
}
e=getEventObject(e);
dp.setMonth(e.value);
};
this._monthSelect.onclick=function(e){
if(e==null){
e=$win().event;
}
e=getEventObject(e);
e.cancelBubble=true;
};
this._yearSelect.onchange=function(e){
if(e==null){
e=$win().event;
}
e=getEventObject(e);
dp.setYear(e.value);
};
$doc().body.insertBefore(this._calDiv,$doc().body.firstChild);
return this._calDiv;
};
Calendar.prototype._update=function(){
var _20=this._currentDate;
var _21=toISODate(new Date());
var _22="";
if(this._selectedDate!=null){
_22=toISODate(this._selectedDate);
}
var _23=toISODate(this._currentDate);
var d1=new Date(_20.getFullYear(),_20.getMonth(),1);
var _25=(d1.getDay()-this._firstDayOfWeek+7)%7;
for(var _26=0;_26<42;_26++){
var i=1-_25+_26;
d1=new Date(_20.getFullYear(),_20.getMonth(),i);
this._dateSlot[_26].value=i;
this._dateSlot[_26].data.firstChild.data=d1.getDate();
this._dateSlot[_26].data.parentNode.className="weekDay";
if(_26%7==0){
this._dateSlot[_26].data.parentNode.className+=" sunday";
}
if(_26%7==6){
this._dateSlot[_26].data.parentNode.className+=" saturday";
}
if(d1.getMonth()!=_20.getMonth()){
this._dateSlot[_26].data.parentNode.className+=" grey";
}
if(toISODate(d1)==_21){
this._dateSlot[_26].data.parentNode.className+=" today";
}
if(toISODate(d1)==_22){
this._dateSlot[_26].data.parentNode.className+=" selected";
}else{
if(toISODate(d1)==_23){
this._dateSlot[_26].data.parentNode.className+=" current";
}
}
}
if(this._includeWeek){
d1=new Date(_20.getFullYear(),_20.getMonth(),1);
for(i=0;i<6;++i){
if(i==5&&false){
this._weekSlot[i].data.data=_1;
}else{
week=weekNumber(this,d1);
this._weekSlot[i].data.data=week;
}
d1=new Date(d1.getFullYear(),d1.getMonth(),d1.getDate()+7);
}
}
};
Calendar.prototype.show=function(_28){
if(!this._showing){
var p=getPoint(_28);
var _2a=$doc().body.scrollLeft+$doc().body.clientWidth;
this._calDiv.style.display="block";
if(p.x+this._calDiv.offsetWidth>_2a){
p.x=_2a-this._calDiv.offsetWidth;
}
this._calDiv.style.top=(p.y+_28.offsetHeight+1)+"px";
this._calDiv.style.left=p.x+"px";
this._showing=true;
if(this._bw.ie6){
dw=this._calDiv.offsetWidth;
dh=this._calDiv.offsetHeight;
var _2b=$doc().body;
if(!_2b){
return;
}
var _2c=this._calDiv.cloneNode(false);
_2c.style.zIndex="390";
_2c.style.margin="0px";
_2c.style.padding="0px";
_2c.style.border="none";
_2c.innerHTML="<iframe width='"+dw+"' height='"+dh+"' frameborder='0'></iframe>";
_2b.insertBefore(_2c,_2b.firstChild);
this._underDiv=_2c;
}
if(!this._alwaysVisible){
Calendar._popupCal=this;
}
if(this._bw.ie){
this._calDiv.focus();
}
}
};
Calendar.prototype.hide=function(){
if(this._showing){
this._calDiv.style.display="none";
this._showing=false;
if(this._bw.ie6){
if(this._underDiv){
this._underDiv.removeNode(true);
}
}
Calendar._popupCal=null;
}
};
Calendar.prototype.toggle=function(_2d){
if(this._showing){
this.hide();
}else{
this.show(_2d);
}
};
Calendar.prototype.onchange=function(){
};
Calendar.prototype.setCurrentDate=function(_2e){
_2e=this.toDate(_2e);
if(_2e==null){
return;
}
if(this._currentDate.getDate()!=_2e.getDate()||this._currentDate.getMonth()!=_2e.getMonth()||this._currentDate.getFullYear()!=_2e.getFullYear()){
this._currentDate=new Date(_2e);
this._updateHeader();
this._update();
return true;
}
return false;
};
Calendar.prototype.setSelectedDate=function(_2f){
_2f=this.toDate(_2f);
if(_2f==null){
this.clearSelectedDate();
return;
}
this._selectedDate=new Date(_2f);
if(!this.setCurrentDate(this._selectedDate)){
this._update();
}
if(typeof this.onchange=="function"){
this.onchange();
}
};
Calendar.prototype.clearSelectedDate=function(){
this._selectedDate=null;
this._currentDate=new Date();
this._updateHeader();
this._update();
if(typeof this.onchange=="function"){
this.onchange();
}
};
Calendar.prototype.toDate=function(_30){
if(typeof _30=="number"){
_30=new Date(_30);
}
if(typeof _30=="string"){
_30=parseDate(_30);
}
if(_30==null||isNaN(_30)){
return null;
}
return _30;
};
Calendar.prototype.getElement=function(){
return this._calDiv;
};
Calendar.prototype.getSelectedDate=function(){
if(this._selectedDate==null){
return null;
}else{
return new Date(this._selectedDate);
}
};
Calendar.prototype._updateHeader=function(){
var _31=this._monthSelect.options;
var m=this._currentDate.getMonth();
for(var i=0;i<_31.length;++i){
_31[i].selected=false;
if(_31[i].value==m){
_31[i].selected=true;
}
}
_31=this._yearSelect.options;
var _34=this._currentDate.getFullYear();
for(var i=0;i<_31.length;++i){
_31[i].selected=false;
if(_31[i].value==_34){
_31[i].selected=true;
}
}
};
Calendar.prototype.setYear=function(_35){
var d=new Date(this._currentDate);
d.setFullYear(_35);
this.setCurrentDate(d);
};
Calendar.prototype.setMonth=function(_37){
var d=new Date(this._currentDate);
d.setMonth(_37);
this.setCurrentDate(d);
};
Calendar.prototype.nextMonth=function(){
this.setMonth(this._currentDate.getMonth()+1);
};
Calendar.prototype.prevMonth=function(){
this.setMonth(this._currentDate.getMonth()-1);
};
Calendar.prototype.setIncludeWeek=function(b){
this._includeWeek=b;
};
Calendar.prototype.setYearBeforeMonth=function(b){
this._yearBeforeMonth=b;
};
Calendar.prototype.setFirstDayOfWeek=function(n){
this._firstDayOfWeek=n;
};
Calendar.prototype.getFirstDayOfWeek=function(){
return this._firstDayOfWeek;
};
Calendar.prototype.setMinimalDaysInFirstWeek=function(n){
this._minimalDaysInFirstWeek=n;
};
Calendar.prototype.getMinimalDaysInFirstWeek=function(){
return this._minimalDaysInFirstWeek;
};
Calendar.prototype.setMonthNames=function(a){
this._monthNames=a;
};
Calendar.prototype.setShortMonthNames=function(a){
this._shortMonthNames=a;
};
Calendar.prototype.setWeekNumberHead=function(s){
this._weekNumberHead=s;
};
Calendar.prototype.setWeekDayHeads=function(a){
this._weekDayHeads=a;
};
Calendar.prototype.setWeekDayNames=function(a){
this._weekDayNames=a;
};
Calendar.prototype.setShortWeekDayNames=function(a){
this._shortWeekDayNames=a;
};
Calendar.prototype.setShortWeekDayNames=function(a){
this._shortWeekDayNames=a;
};
Calendar.prototype.setTinyWeekDayNames=function(a){
this._tinyWeekDayNames=a;
};
Calendar.prototype.setTodayButtonFormat=function(s){
this._todayButtonFormat=s;
};
Calendar.prototype.setClearButtonText=function(s){
this._clearButtonText=s;
};
Calendar.prototype.getFormat=function(){
return this._format;
};
Calendar.prototype.setFormat=function(f){
this._format=f;
};
Calendar.prototype.formatDate=function(_48,_49){
if(!_48){
_48=this._selectedDate;
}
if(_48==null){
return "";
}
var _4a=""+_48.getFullYear();
_4a=(_4a.length==2)?"19"+_4a:_4a;
var frm=new String(_49?_49:this._format);
var _4c={"yyyy":_4a,"yy":_4a.substr(2,2),"MMMM":this._monthNames[_48.getMonth()],"MMM":this._shortMonthNames[_48.getMonth()],"MM":pad(_48.getMonth()+1,2),"M":_48.getMonth()+1,"dd":pad(_48.getDate(),2),"d":_48.getDate(),"EEEE":this._weekDayNames[_48.getDay()],"EEE":this._shortWeekDayNames[_48.getDay()],"EE":this._tinyWeekDayNames[_48.getDay()],"E":this._tinyWeekDayNames[_48.getDay()]};
var _4d="";
LoopI:
for(var i=0;i<frm.length;i++){
for(var _4f in _4c){
if(frm.substr(i,_4f.length)==_4f){
_4d+=_4c[_4f];
i+=_4f.length-1;
continue LoopI;
}
}
_4d+=frm.charAt(i);
}
return _4d;
};
function isLeapYear(_50){
return ((_50%4==0)&&((_50%100!=0)||(_50%400==0)));
}
function yearLength(_51){
if(isLeapYear(_51)){
return 366;
}else{
return 365;
}
}
function dayOfYear(_52){
var a=Calendar.NUM_DAYS;
if(isLeapYear(_52.getFullYear())){
a=Calendar.LEAP_NUM_DAYS;
}
var _54=_52.getMonth();
return a[_54]+_52.getDate();
}
function weekNumber(cal,_56){
var dow=_56.getDay();
var doy=dayOfYear(_56);
var _59=_56.getFullYear();
var _5a=(dow+7-cal.getFirstDayOfWeek())%7;
var _5b=(dow-doy+701-cal.getFirstDayOfWeek())%7;
var _5c=Math.floor((doy-1+_5b)/7);
if((7-_5b)>=cal.getMinimalDaysInFirstWeek()){
++_5c;
}
if(doy>359){
var _5d=yearLength(_59);
var _5e=(_5a+_5d-doy)%7;
if(_5e<0){
_5e+=7;
}
if(((6-_5e)>=cal.getMinimalDaysInFirstWeek())&&((doy+7-_5a)>_5d)){
_5c=1;
}
}else{
if(_5c==0){
var _5f=doy+yearLength(_59-1);
_5c=weekOfPeriod(cal,_5f,dow);
}
}
return _5c;
}
function weekOfPeriod(cal,_61,_62){
var _63=(_62-cal.getFirstDayOfWeek()-_61+1)%7;
if(_63<0){
_63+=7;
}
var _64=Math.floor((_61+_63-1)/7);
if((7-_63)>=cal.getMinimalDaysInFirstWeek()){
++_64;
}
return _64;
}
function getEventObject(e){
if(navigator.appName=="Microsoft Internet Explorer"){
return e.srcElement;
}else{
var o=e.target;
while(!o.tagName){
o=o.parentNode;
}
return o;
}
}
function addEvent(_67,obj,_69){
if(navigator.appName=="Microsoft Internet Explorer"){
obj.attachEvent("on"+_67,_69);
}else{
obj.addEventListener(_67,_69,false);
}
}
function deleteEvent(_6a,obj,_6c){
if(navigator.appName=="Microsoft Internet Explorer"){
obj.detachEvent("on"+_6a,_6c);
}else{
obj.removeEventListener(_6a,_6c,false);
}
}
function setCursor(obj){
if(navigator.appName=="Microsoft Internet Explorer"){
obj.style.cursor="hand";
}else{
obj.style.cursor="pointer";
}
}
function Point(iX,iY){
this.x=iX;
this.y=iY;
}
function getPoint(_70){
var _71=_70;
var _72=new Point(0,0);
do{
_72.x+=_71.offsetLeft;
_72.y+=_71.offsetTop;
_71=_71.offsetParent;
}while(_71.tagName!="BODY");
return _72;
}
function toISODate(_73){
var s=_73.getFullYear();
var m=_73.getMonth()+1;
if(m<10){
m="0"+m;
}
var day=_73.getDate();
if(day<10){
day="0"+day;
}
return String(s)+String(m)+String(day);
}
function pad(_77,X){
X=(!X?2:X);
_77=""+_77;
while(_77.length<X){
_77="0"+_77;
}
return _77;
}
function bw_check(){
var _79=parseInt(navigator.appVersion);
this.nver=_79;
this.ver=navigator.appVersion;
this.agent=navigator.userAgent;
this.dom=document.getElementById?1:0;
this.opera=window.opera?1:0;
this.ie5=(this.ver.indexOf("MSIE 5")>-1&&this.dom&&!this.opera)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1&&this.dom&&!this.opera)?1:0;
this.ie4=(document.all&&!this.dom&&!this.opera)?1:0;
this.ie=this.ie4||this.ie5||this.ie6;
this.mac=this.agent.indexOf("Mac")>-1;
this.ns6=(this.dom&&parseInt(this.ver)>=5)?1:0;
this.ie3=(this.ver.indexOf("MSIE")&&(_79<4));
this.hotjava=(this.agent.toLowerCase().indexOf("hotjava")!=-1)?1:0;
this.ns4=(document.layers&&!this.dom&&!this.hotjava)?1:0;
this.bw=(this.ie6||this.ie5||this.ie4||this.ns4||this.ns6||this.opera);
this.ver3=(this.hotjava||this.ie3);
this.opera7=((this.agent.toLowerCase().indexOf("opera 7")>-1)||(this.agent.toLowerCase().indexOf("opera/7")>-1));
this.operaOld=this.opera&&!this.opera7;
return this;
}
function hideCalendar(e){
if(Calendar._popupCal&&Calendar._popupCal._showing){
if(e==null){
e=$win().event;
}
var o=getEventObject(e);
while(o!=null&&o!=$doc().body){
if(o==Calendar._popupCal._calDiv){
return;
}
o=o.parentNode;
}
Calendar._popupCal.hide();
}
}
function initDatePickers(div){
}
function setDateInputDisabled(e,_7e){
e.disabled=_7e;
e.nextSibling.style.display=_7e?"none":"inline";
if(_7e){
e.style.backgroundColor="#DDDDDD";
}else{
e.style.backgroundColor="";
}
}
function showCalendar(_7f){
var cal=showCalendar.cal;
if(!cal){
showCalendar.cal=cal=new Calendar();
if(typeof gCalendar_initCalendar=="function"){
gCalendar_initCalendar(cal);
}
cal.create();
Event.observe($doc(),"mousedown",hideCalendar);
}
cal.hide();
cal.onchange=null;
cal.setSelectedDate(_7f.value);
cal.onchange=function(){
_7f.value=cal.formatDate();
if(_7f.onchange){
_7f.onchange();
}
};
cal.show(_7f);
}
function setDate(_81,_82,n){
var _84=new Date();
_81.value=fmtDate(_84);
_84.setDate(_84.getDate()+n);
_82.value=fmtDate(_84);
}
function setMonth(_85,_86,n){
var _88=new Date();
_85.value=fmtDate(_88);
_88.setMonth(_88.getMonth()+n);
_86.value=fmtDate(_88);
}
function setYear(_89,_8a,n){
var _8c=new Date();
_89.value=fmtDate(_8c);
_8c.setYear(_8c.getYear()+n);
_8a.value=fmtDate(_8c);
}
function setT(_8d,_8e,n){
switch(n){
case "0":
setDate(_8d,_8e,0);
break;
case "1":
setDate(_8d,_8e,-7);
break;
case "2":
setMonth(_8d,_8e,-1);
break;
case "3":
setYear(_8d,_8e,-1);
break;
default:
}
}
function fmtDate(d){
var _91=d.getYear();
var _92=d.getMonth()+1;
var _93=d.getDate();
if(_91<100){
_91+=1900;
}
if(_92<10){
_92="0"+_92;
}
if(_93<10){
_93="0"+_93;
}
return _91+"-"+_92+"-"+_93;
}
function parseDate(s){
var i1=s.indexOf("-");
var i2=s.indexOf("-",i1+1);
if(i1<0||i2<0){
return null;
}
return new Date(parseInt(s.substring(0,i1),10),parseInt(s.substring(i1+1,i2),10)-1,parseInt(s.substring(i2+1),10));
}
var _97;
function initDoc(doc){
_97=doc;
}
function $doc(){
return _97;
}
function $win(){
return _97.window;
}
})();

var Template={};
(function(){
var _1=false;
var _2=Class.create();
var _3=Class.create();
var _4=Class.create();
var _5=Class.create();
var _6=Class.create();
_2.pattern=/<!--\s*#\s*((for-each|if|else-if)\s*\((.*?)\)|(end-for|end-if|else))\s*-->/;
_2.prototype={initialize:function(s){
var _8=[],next=0;
FindScriptStart:
for(var _9;(_9=s.indexOf("${",next))!=-1;){
var _a=_9+1;
var _b=1;
while(_b>0){
var _c=s.substr(_a+1).search(/{|}/);
if(_c==-1){
break FindScriptStart;
}
_a+=(_c+1);
if(s.charAt(_a)=="{"){
_b++;
}else{
_b--;
}
}
_8.push(s.substring(next,_9));
var _d=unescape(s.substring(_9+2,_a));
next=_a+1;
_8.push(new _6(_d));
}
_8.push(s.substr(next));
this.s=_8;
},exec:function(_e){
var _f=[],l=this.s.length;
for(var i=0;i<l;++i){
if(typeof this.s[i]=="string"){
_f.add(this.s[i]);
}else{
_f.add(this.s[i].exec(_e));
}
}
return _f.join("");
},dump:function(_11,_12,_13){
var _14=[(_11||"")+"Statement :"],l=this.s.length;
for(var i=0;i<l;++i){
var ts=this.s[i];
if(typeof this.s[i]=="string"){
if(ts.length<20){
_14.add(ts.replace(/\s*/g,""));
}else{
_14.add(ts.substr(0,10).replace(/\s*/g,"")+"..."+ts.substr(ts.length-10).replace(/\s*/g,""));
}
}else{
_14.add(ts.dump());
}
}
return _14.join("");
}};
function parseStatement(s){
var _18=[new _3()];
var _19=_2.pattern;
var tag;
while(tag=_19.exec(s)){
if(tag.index>0){
_18.last().addStatement(_18,s.substring(0,tag.index));
}
if(!tag[2]){
_18=_18.last().onToken(_18,tag[1]);
}else{
_18=_18.last().onToken(_18,tag[2],tag[3]);
}
s=s.substring(tag.index+tag[0].length);
}
if(s){
_18.last().addStatement(_18,s);
}
if(_18.length!=1){
fDebug("Template.parse : not reach the end.");
}
return _18[0];
}
_3.prototype={initialize:function(){
this.ary=[];
},exec:function(env){
var a=[];
this.ary.each(function(s){
a.push(s.exec(env));
});
return a.join("");
},dump:function(_1e,_1f,_20){
var a=[];
this.ary.each(function(s){
a.push(s.dump(_1e,_1f,_20));
});
return a.join(_20);
},addStatement:function(_23,s){
this.ary.push(new _2(s));
},onToken:function(_25,t,f){
var ns=null;
if(t=="for-each"){
ns=new _4(f);
}else{
if(t=="if"){
ns=new _5(f);
}
}
if(ns){
this.ary.push(ns);
_25.push(ns);
}
return _25;
}};
_6.prototype={initialize:function(s){
this.$$$$$=s;
},exec:function(env){
try{
with(env||{}){
return (eval(this.$$$$$));
}
}
catch(ex){
fDebug("sEval.exec for "+this.$$$$$,ex);
return "";
}
},dump:function(){
return "${"+this.$$$$$+"}";
}};
_4.prototype={initialize:function(s){
var i=s.indexOf(":");
this.key=s.substr(0,i).replace(/(^\s*)|(\s*$)/g,"");
this.val=s.substr(i+1);
this.loop=new _3();
},exec:function(env){
var __a=[];
var old=env[this.key],oldI=env["index"];
var _30;
var _31=this.val;
with(env){
_30=eval(unescape(_31));
}
var _32=this.loop;
var _33=this.key;
if(_30.each){
_30.each(function(s,_35){
env[_33]=s;
env["index"]=_35;
__a.push(_32.exec(env));
});
}else{
if(typeof (_30)=="object"){
var _36=0;
for(var __i in _30){
env[_33]=__i;
env["index"]=_36++;
__a.push(_32.exec(env));
}
}
}
env[_33]=old;
env["index"]=oldI;
return __a.join("");
},dump:function(_38,_39,_3a){
if(!_38){
_38="";
}
return _38+"for-each("+this.key+":"+this.val+")\r\n"+this.loop.dump(_38+_39,_39,_3a);
},addStatement:function(_3b,s){
this.loop.addStatement(_3b,s);
},onToken:function(_3d,t,f){
if(!f){
_3d.pop();
}else{
this.loop.onToken(_3d,t,f);
}
return _3d;
}};
_5.prototype={initialize:function(s){
this.cond=[{cond:s,sq:new _3(),isif:true}];
},exec:function(env){
var a=[];
this.cond.each(function(s){
var _44;
var _45=s.cond;
with(env){
_44=eval(unescape(_45));
}
if(!!_44){
a.push(s.sq.exec(env));
throw $break;
}
});
return a.join("");
},dump:function(_46,_47,_48){
if(!_46){
_46="";
}
var a=[];
this.cond.each(function(s){
if(s.isif){
a.push(_46+"if("+s.cond+")");
}else{
if(s.iselse){
a.push(_46+"else");
}else{
a.push(_46+"else if("+s.cond+")");
}
}
a.push(s.sq.dump(_46+_47,_47,_48));
});
return a.join("\r\n");
},addStatement:function(_4b,s){
this.cond.last().sq.addStatement(_4b,s);
},onToken:function(_4d,t,f){
if(t=="else-if"){
this.cond.push({cond:f,sq:new _3()});
}else{
if(t=="else"){
this.cond.push({cond:true,sq:new _3,iselse:true});
}else{
if(!f){
_4d.pop();
}else{
return this.cond.last().sq.onToken(_4d,t,f);
}
}
}
return _4d;
}};
var _50={};
var _51=/<!--\s*#\s*(block\s*\((.*)\)|end-block)\s*-->/;
var _52={};
var _53={};
function addSlot(key,_55){
var _56=_53[key];
if(_56===_52){
return false;
}
if(!_56){
_56=_53[key]=[];
}
_56.push(_55);
return true;
}
Template.signal=signal;
function signal(key,val){
if(val){
_50[key]=val;
}
var _59=_53[key]||[];
_53[key]=_52;
while(_59.length>0){
_59.pop()();
}
}
Template.load=function(_5a,_5b){
_5a=$$A(_5a);
var _5c=_5a.length;
var _5d=-1;
function checkFinish(){
if(++_5d>=_5c){
UI.hideWaiting();
_5b();
}
}
checkFinish();
for(var i=0;i<_5c;++i){
var _5f=_5a[i];
if(!addSlot(_5f,checkFinish)){
checkFinish();
continue;
}
var _60=("?"+CC.rev);
if(_5f.endsWith(".js")){
loadJS(_5f,_60);
}else{
new Ajax.Request(CC.getURL("templates/")+_5f+_60,{method:"get",onSuccess:templateLoaded.bind(null,_5f)});
}
}
function templateLoaded(_61,_62){
signal(_61,splitHtml(_62.responseText));
}
function splitHtml(s){
var res={};
var _65=null;
var tag;
while(tag=_51.exec(s)){
if(tag[1]=="end-block"){
if(!_65){
throw new Error("Unexpected "+tag[1]);
}
res[_65]={src:parseStatement(s.substring(0,tag.index))};
_65=null;
}else{
if(_65){
throw new Error("Block "+_65+" not ended before block "+tag[2]);
}
_65=tag[2].trim();
}
s=s.substring(tag.index+tag[0].length);
}
if(_65){
throw new Error("Block "+_65+" not ended before EOF");
}
return res;
}
};
function loadJS(_67,_68){
var src=CC.getURL("js/"+_67);
var _6a=document.getElementsByTagName("head")[0];
var _6b=_6a.getElementsByTagName("script");
for(var i=0;i<_6b.length;i++){
if(_6b[i].src.indexOf(src)!=-1){
signal(_67);
return;
}
}
var _6d=document.createElement("script");
_6d.charset="iso-8859-1";
_6d.src=src+_68;
_6a.appendChild(_6d);
UI.showWaiting(gLang.GLOBAL.tips_loading);
}
Template.clearCache=function(){
UI.prompt("Clear Cache","What module do you want to reload for",GE.laterRequestModule||"",function(_6e){
var _6f=_6e.value.trim();
if(_6f){
if(!MM[_6f]){
alert("Module not found: "+_6f);
return;
}
for(var _70 in _50){
if(_50[_70]&&$$A(MM[_6f].dependence).include(_70)){
delete _53[_70];
delete _50[_70];
}
}
GE.laterRequestModule=null;
MM[_6f].load=false;
MM.execute(_6f);
}
});
};
function findTemplate(_71,_72){
_71=$$A(_71);
for(var i=0;i<_71.length;++i){
if(_71[i].indexOf(".js")==-1){
var _74=_50[_71[i]];
if(_74&&_74[_72]){
return _74;
}
}
}
return null;
}
function executeFragment(_75,_76,_77){
var _78=_75&&_75[_76]&&_75[_76].src;
if(!_78){
fDebug("executeTemplate","Fragment not found: "+_76);
return "";
}
if(_1){
alert(_78.dump("","--","\r\n"));
}
var env={call:function(_7a,_7b){
return executeFragment(_75,_7a,_7b);
}};
Object.extend(env,_77);
return _78.exec(env);
}
Template.get=function(_7c,_7d,_7e,_7f){
var _80=findTemplate(_7c,_7d);
var _81=_80&&_80[_7d];
if(_81&&_7f){
if(!_81.cache){
_81.cache=executeFragment(_80,_7d,_7e);
}
return _81.cache;
}
return executeFragment(_80,_7d,_7e);
};
Template.fill=function(_82,_83,_84){
var k,d;
for(k in _82){
d=$(k);
if(d){
d.innerHTML=_82[k];
}
}
if(_83&&_83.length){
for(k=0;k<_83.length;++k){
d=$(_83[k][0]);
if(d){
d[_83[k][1]]=_83[k][2];
}
}
}
if(_84&&_84.length){
for(k=0;k<_84.length;++k){
d=$(_84[k][0]);
if(d){
d.style[_84[k][1]]=_84[k][2];
}
}
}
};
})();

function fGetInfoCenterHTML(){
return "";
}
function fGetWelAdHTML(){
return "";
}
function fGetTodayHTML(){
return "";
}
function fGetServiceHTML(){
return "";
}
function fGetSendTopAdHTML(i){
var _2="<div class=\"mAdArea border2\">"+"<iframe src=\"about:blank\" class=\"mAdFrame\" frameborder=\"0\"></iframe>"+"</div>";
GE.topAdHeight=87;
return _2;
}

var gApps=[];
gApps.mbox=gApps[0]={tree:"ulMyFolders",lbl:"liMail"};
gApps.pab=gApps[1]={tree:"ulMyAddressTree",lbl:"liPAB"};
gApps.oab=gApps[2]={tree:"ulOrgAddressTree",lbl:"liOAB"};
gApps.cal=gApps[3]={tree:"ulCalendar",lbl:"liCAL"};
gApps.nf=gApps[4]={tree:"ulNFFolders",lbl:"liNF"};
function ModuleManager(){
var _1={welcome:["",true,0,false,false,gLang.GLOBAL.mod.welcome,0,0,"mboxIco"],unRead:["",true,2,false,true,,0,0,"searchIco"],inbox:["f:CM$LoadFolder(1)",true,1,false,true,,0,0,"icoInbox"],draft:["f:CM$LoadFolder(2)",true,1,false,true,,0,0,"icoDraft"],sended:["f:CM$LoadFolder(3)",true,1,false,true,,0,0,"icoHsnd"],deleted:["f:CM$LoadFolder(4)",true,1,false,true,,0,0,"icoDel"],defined5:["f:CM$LoadFolder(5)",true,1,false,true,,0,0,"icoSpam"],defined6:["f:CM$LoadFolder(6)",true,1,false,true,,0,0,"icoVirus"],read:["",false,0,false,true,gLang.GLOBAL.mod.read,0,0,"readIco"],compose:["",true,0,true,true,gLang.GLOBAL.mod.compose,0,0,"icoT_wl"],receiptopt:["",false,0,false,true,gLang.GLOBAL.mod.receiptopt,0,0,"icoT_wl"],outLink:["",false,0,false,false,gLang.GLOBAL.mod.outLink,0,0,"serIco"],send:["",true,0,false,true,gLang.GLOBAL.mod.send,0,0,"icoT_wl"],readForward:["",false,0,false,true,gLang.GLOBAL.mod.readForward,0,0,"icoT_wl"],searchmail:["f:",true,0,true,true,gLang.GLOBAL.mod.searchmail,0,1,"setIco"],option:["",false,0,true,false,gLang.GLOBAL.mod.option,0,1,"setIco"],personal:["f:CMXMail.loadPersonal()",true,0,false,true,gLang.GLOBAL.mod.personal,0,1,"setIco"],password:["",false,0,false,false,gLang.GLOBAL.mod.password,0,1,"setIco"],question:["",true,0,false,true,gLang.question.title,0,1,"setIco"],preference:["f:CMXMail.loadPreference()",true,0,false,true,gLang.GLOBAL.mod.preference,0,1,"setIco"],signature:["f:CMXMail.loadSignature()",true,0,false,true,gLang.GLOBAL.mod.signature,0,1,"setIco"],forward:["f:CMXMail.loadForward()",true,0,false,true,gLang.GLOBAL.mod.forward,0,1,"setIco"],autoresp:["f:CMXMail.loadAutoResp()",true,0,false,true,gLang.GLOBAL.mod.autoresp,0,1,"setIco"],timeset:["f:CMXMail.loadTimedSend()",true,0,false,true,gLang.GLOBAL.mod.timeset,0,1,"setIco"],pop3:["f:CMXMail.loadPop3Setting()",true,0,false,true,gLang.GLOBAL.mod.pop3,0,1,"setIco"],refuselist:["f:CMXMail.loadRefuseList()",true,0,false,true,gLang.GLOBAL.mod.refuselist,0,1,"setIco"],friends:["f:CMXMail.loadSafeList()",true,0,false,true,gLang.GLOBAL.mod.friends,0,1,"setIco"],listfilter:["f:CMXMail.loadMailRules()",true,0,false,true,gLang.GLOBAL.mod.listfilter,0,1,"setIco"],mailfilter:["",true,0,true,false,gLang.GLOBAL.mod.mailfilter,0,1,"setIco"],junkfilter:["f:CMXMail.loadJunkFilter()",true,0,false,true,gLang.GLOBAL.mod.junkfilter,0,1,"setIco"],antivirus:["f:CMXMail.loadAntivirusOpt()",true,0,false,true,gLang.GLOBAL.mod.antivirus,0,1,"setIco"],smsnotify:["f:CMXMail.loadSmsNotify()",true,0,false,true,gLang.GLOBAL.mod.smsnotify,0,1,"setIco"],phonebinding:["f:CMXMail.loadPhoneBinding()",true,0,false,true,gLang.GLOBAL.mod.phonebinding,0,1,"setIco"],smsValidate:["",true,0,true,false,gLang.GLOBAL.mod.smsValidate,0,1,"setIco"],facemanager:["",true,0,false,true,gLang.GLOBAL.mod.facemanager,0,1,"setIco"],address:["f:CMXMail.loadAddress()",true,0,false,true,gLang.GLOBAL.mod.address,1,0,"icoAdb"],orgaddr:["f:CMXMail.loadOrgAddress()",true,0,false,true,gLang.GLOBAL.mod.orgaddress,2,0,"icoOrgAdb"],nf:["",true,0,false,true,,4,14,""],nfsearch:["",true,0,false,true,gLang.search.resultTitle,4,15,"searchIco"],calendar:["f:CMXMail.loadCalendar()",true,0,false,true,gLang.GLOBAL.mod.calendar,3,0,"icoCal"]};
var _2=["cm/opt.js","option.js","option.htm"];
for(var o in _1){
this[o]=new ModuleStatus(_1[o][0],_1[o][1],_1[o][2],_1[o][3],_1[o][4],_1[o][5],_1[o][6],_1[o][7],_1[o][8]);
if(this[o].group==1){
this[o].dependence=_2;
}
}
this.welcome.dependence=["main.htm"];
this.compose.dependence=["composemodule.js","composemodule1.js","CMUploadForA.js","cm/mmatt.js","cm/compose_op.js","address.js","orgaddr.js"].concat(_2);
var _4=["cm/opt.js","address.js","address.htm"];
this.address.dependence=_4;
this.orgaddr.dependence=_4.concat("orgaddr.js");
this.nf.dependence=this.nfsearch.dependence=["netfoldermodule.js","netfolder.htm"];
this.calendar.dependence=["cm/cal.js","cm/opt.js","modules/calendar.js","uicalgrid.js","calendar.htm"];
}
var gInboxFlag={"unRead":"0","inbox":"1","draft":"2","sended":"3","deleted":"4","defined5":"5","defined6":"6"};
var gGetNewMailInterval=180000;
var gInitModules=[];
var g_TdCssClassName="autofinish_over";
var g_TbCssClassName="autofinish";
var gDebugInfo="";
var gBeginMoving=false;
var gSourceDiv=null;
var gDestDiv=null;
var gAppName="";
var gVersion=0;
var sUrl="";
var gTips=[];
var Tips=gLang.help["Tips"];
for(var i=0;i<Tips.length;++i){
var s=Tips[i];
gTips[i]=s.replace("%add","javascript:fGoto(\"MM.execute\",\"address\");").replace("%pop3","javascript:fGoto(\"MM.execute\",\"pop3\");").replace("%sig","javascript:fGoto(\"MM.execute\",\"signature\");").replace("%filter","javascript:fGoto(\"MM.execute\",\"listfilter\");");
}
String.prototype.toInt=fToInt;
String.prototype.usc_hdc=fUsc_hdc;
String.prototype.trim=fTrim;
String.prototype.ltrim=fLtrim;
String.prototype.rtrim=fRtrim;
String.prototype.cleanBlank=fCleanBlank;
String.prototype.len=fLen;
String.prototype.htmlencode=fHtmlencode;
String.prototype.htmldecode=fHtmldecode;
String.prototype.left=fLeft;
String.prototype.isNumber=fIsNumber;
Date.prototype.dateAdd=fDateAdd;
function El(){
}
El.toggle=Element.toggle;
El.hide=Element.hide;
El.show=Element.show;
El.remove=Element.remove;
El.insertElement=fInsertElement;
El.nextSibling=fNextSibling;
El.preSibling=fPreSibling;
El.createElement=fCreateElement;
El.setAttr=fSetAttr;
El.setStyle=Element.setStyle;
El.addClass=Element.addClassName;
El.removeClass=Element.removeClassName;
El.getX=function(e){
return El.position(e)[0];
};
El.getY=function(e){
return El.position(e)[1];
};
El.position=Position.cumulativeOffset;
function fHtmldecode(){
var _7=this;
_7=_7.replace(/&amp;/gi,"&");
_7=_7.replace(/&lt;/gi,"<");
_7=_7.replace(/&gt;/gi,">");
_7=_7.replace(/&quot;/gi,"\"");
return _7;
}
function fHtmlencode(){
var _8=this;
_8=_8.replace(/&/gi,"&amp;");
_8=_8.replace(/</gi,"&lt;");
_8=_8.replace(/>/gi,"&gt;");
_8=_8.replace(/\"/gi,"&quot;");
return _8;
}
function fReplaceQuot(_9){
var re;
var s="";
re=/&quot;/g;
s=_9.replace(re,"");
return s;
}
function fDebug(_c,_d){
var _e=(new Date()).toLocaleString();
var _f=window.parent.frames["debugFrame"].document;
var div=_f.createElement("DIV");
var _11="FUNCTION:"+_c+"\n";
if(_d&&_d.description){
_11+=" --- Description:"+_d.description+"\n";
}else{
if(_d&&_d.message){
_11+=" --- Message:"+_d.message+"\n";
}else{
_11+=" --- Info:"+_d+"\n";
}
}
if(_d&&_d.stack){
_11+=" --- StackTrace:\n"+_d.stack+"\n";
}else{
if(fDebug.caller){
try{
_11+=" --- CallerStack:\n";
var cc=fDebug.caller;
var j=6;
while(cc!=null&&j-->0){
var s=cc.toString();
s=s.substring(0,s.indexOf("(")).trim();
if(s.substring(0,8)=="function"){
s=s.substring(8).ltrim();
}
if(!s){
s="anonymous";
}
_11+=s+"(";
for(var i=0;i<cc.arguments.length;i++){
if(i>0){
_11+=",";
}
if(typeof cc.arguments[i]=="string"){
_11+="\"";
}
_11+=cc.arguments[i];
if(typeof cc.arguments[i]=="string"){
_11+="\"";
}
}
_11+=")\n";
cc=cc.caller;
}
}
catch(ex){
alert(ex.description);
}
}
}
div.innerHTML=_11;
_f.getElementsByTagName("BODY")[0].appendChild(div);
CC.getAjaxMsg(gDebugInfo+" -- "+protimelist+" -- "+_11+" -- History:"+HM.arrHistory.join(" > "));
}
function fCheckDate(_16){
var arr=_16.split("-");
var d=new Date(arr[0],arr[1]-1,arr[2]);
if(d.getFullYear()!=arr[0]||(d.getMonth()+1)!=parseInt(arr[1],10)||d.getDate()!=parseInt(arr[2],10)){
return false;
}
return true;
}
function fnErrorTrap(msg,url,_1b){
try{
var _1c="Error: "+msg;
_1c+=" > Url: "+url;
_1c+=" > Line: "+_1b;
fDebug("window.onerror",_1c);
}
catch(e){
}
return true;
}
window.onerror=fnErrorTrap;
function fTrim(){
return this.replace(/(^\s*)|(\s*$)/g,"");
}
function fLtrim(){
return this.replace(/(^\s*)/g,"");
}
function fRtrim(){
return this.replace(/(\s*$)/g,"");
}
function fCleanBlank(){
return this.replace(/\s/g,"");
}
function fLen(){
var len=0;
for(var i=0;i<this.length;i++){
if(this.charCodeAt(i)>255){
len+=2;
}else{
len++;
}
}
return len;
}
function fToInt(){
return parseInt(this,10);
}
function fUsc_hdc(){
return unescape(this.htmldecode());
}
function fLeft(len){
var i=0;
var j=0;
if(this.len()<=len){
return this;
}
while(j<len){
if(this.charCodeAt(i)>255){
j+=2;
}else{
j++;
}
i++;
}
return this.substring(0,i)+"..";
}
function fIsNumber(){
return (this.search(/^\d+$/g)==0);
}
function fDateAdd(n){
return new Date(this.valueOf()+n*3600*24*1000);
}
function fInsertElement(_23,obj,_25){
try{
var _26=_23.parentNode;
var len=_26.childNodes.length;
var pos=-1;
for(var i=0;i<len;i++){
if(_26.childNodes[i]==_23){
pos=i;
}
}
if(_25=="beforeEnd"){
_23.appendChild(obj);
}else{
if(_25=="afterEnd"){
if(pos==len-1){
_26.appendChild(obj);
}else{
_26.insertBefore(obj,_26.childNodes[pos+1]);
}
}else{
if(_25=="beforeBegin"){
_23.insertBefore(obj);
}else{
if(_25=="afterBegin"){
if(_23.childNodes.length==0){
_23.appendChild(obj);
}else{
_23.insertBefore(obj,_23.childNodes[0]);
}
}
}
}
}
}
catch(exp){
fDebug("fInsertElement",exp);
}
}
function fNextSibling(_2a){
try{
var _2b=_2a.parentNode;
var _2c=_2b.childNodes;
for(var i=0;i<_2c.length;i++){
if(_2c[i]==_2a){
if(i==_2c.length-1){
return null;
}else{
return _2c[i+1];
}
}
}
}
catch(exp){
fDebug("fNextSibling",exp);
}
}
function fPreSibling(_2e){
try{
var _2f=_2e.parentNode;
var _30=_2f.childNodes;
for(var i=0;i<_30.length;i++){
if(_30[i]==_2e){
if(i==0){
return null;
}else{
return _30[i-1];
}
}
}
}
catch(exp){
fDebug("fPreSibling",exp);
}
}
function fCreateElement(tag){
return $doc().createElement(tag);
}
function fSetAttr(_33,_34){
for(var o in _34){
_33[o]=_34[o];
}
}
function ModuleStatus(_36,_37,_38,_39,_3a,_3b,tab,_3d,_3e){
this.cmURL=_36;
this.cach=_37;
this.isFolder=_38;
this.loadBeforeCM=_39;
this.requestCM=_3a;
this.name=_3b;
this.tab=tab;
this.group=_3d;
this.icon=_3e;
if(this.isRealFolder()){
this.group=3;
}
}
ModuleStatus.prototype={resize:fCommon_resize,getName:function(){
return this.name;
},getNamePad:function(){
return "";
},getHtml:null,synData:Prototype.emptyFunction,init:Prototype.emptyFunction,exit:function(){
return true;
},getToolbar:function(){
return ["",""];
},clone:null,isRealFolder:function(){
return (this.isFolder==1);
},getLinkId:function(_3f){
return "lnk"+_3f;
},operate:function(){
var _40=$A(arguments);
var op=this[_40.shift()];
if(op){
op.apply(this,_40);
}
},focus:function(){
if(this.dg){
this.dg.focus();
}
},getTemplate:function(div,_43,_44){
return Template.get(this.dependence,div,_43,_44);
}};
var CM={setCMReffer:fSetCMReffer,urlReffer:fURLReffer,letter:{},getUserDisplay:function(){
return CM.User.attrs.true_name||CM.User.email.replace(/@.*/,"");
},getReplyPrefix:function(){
return gLang.reply_flag[CM.User.attrs.replyf||0];
},isReplyWithQuote:function(){
return CM.User.attrs.addo!=1;
},isSaveSent:function(){
return CM.User.attrs.save_sent!=0;
},isDeleteMoveNext:function(){
return CM.User.attrs.afterdel!=0;
},isSignAtLast:function(){
return CM.User.attrs.signature_position!=1;
},isAutoSaveRcpt:function(){
return CM.User.attrs.aftersend_saveaddr!=0;
},isMboxSizeExceed:function(){
return CM.MBOX.getUsedSize()>=CM.MBOX.getQuotaSize();
},isDisplaySender:function(){
return CM.User.attrs.displaysender==0;
}};
var GE=Object.extend(new GlobeEngine(),{changeSkin:fChangeSkin,changeFaceShow:fChangeFaceShow,getThis:fGetThis,getEvent:fGetEvent,changeTab:fChangeTab,addTab:fAddTab});
var frame=new fFrames();
var MM=Object.extend(new ModuleManager(),{createModule:fCreateModule,destroyModule:fDestroyModule,getModule:fGetModule,showModule:fShowModule,hideModules:fHideModules,showToolbar:fShowToolbar,getRead:fGetRead,execute:fModuleExecute});
var HM={isHistory:true,arrHistory:[],getHistory:fGetHistory,backHistory:fGoHistory};
function fSetCMReffer(_45){
try{
var _46=MM[_45].cmURL;
if(_46.substr(0,2)=="f:"){
eval(_46.substr(2));
return true;
}else{
if(_46){
fURLReffer(_46,_45);
return true;
}else{
if(MM[_45].refresh){
MM[_45].refresh();
return true;
}
}
}
}
catch(exp){
fDebug("fSetCMReffer",exp);
}
return false;
}
function fURLReffer(_47,_48){
try{
fFrameUrlReffer(fGetCMFrame(_48),_47);
}
catch(exp){
fDebug("fURLReffer",exp);
}
}
function GlobeEngine(){
this.UID="";
this.User="";
this.IsIE=true;
this.laterRequestModule="";
this.address=null;
this.composeType="";
this.oThis=null;
this.oEvent=null;
this.udid="";
this.readType=0;
this.currentFolder="";
this.isLetterDbClick=false;
this.readOperating=false;
this.bodyHeight="";
this.bodyWidth="";
this.time=new Date();
this.outLink=new Object();
this.editContent="";
this.isFullDisplay=false;
this.localConfig=new Object();
this.keyUpSearchDelay=400;
this.addrFetchSize=200;
this.addrDropDownSize=20;
this.fontsize=3;
}
function GE_Init(){
try{
fGetClientInfo();
fSetPro();
fSetNavDisplay();
fSetTabMenu();
fGetInitModules();
fGetUserAgen();
fGetCMFrame("unRead");
GE.laterRequestModule="welcome";
MBOX_folderChanged();
fGetFirstPage();
$win().wObserve("error",fnErrorTrap);
}
catch(e){
fDebug("GE_Init",e);
}
}
function fSetPro(){
try{
var _49=parent;
GE.UID=CM.User.email;
GE.IsIE=(document.all!=null);
var arr=["con_left_width","con_bottom_height","address_x","orgaddr_x"];
for(var i=0;i<arr.length;i++){
var _4c=parseInt(CC.getCookie(arr[i]),10);
GE.localConfig[arr[i]]=isNaN(_4c)?0:_4c;
}
}
catch(exp){
fDebug("fSetPro",exp);
}
}
function fChangeSkin(_4d){
var _4e=(_4d&&_4d.value)||"";
if(typeof _4d=="string"){
_4e=_4d;
}
$("cssStyle").href=CC.getSkinCSSPath(_4e);
}
function fChangeFaceShow(_4f){
var trs=$("facemanagerForm").getElementsByTagName("tr");
for(var i=0;i<trs.length;i++){
if(trs[i].id){
if(trs[i].id==("skin_"+_4f)||trs[i].id==("local_"+_4f)){
trs[i].style.display="";
}else{
trs[i].style.display="none";
}
}
}
}
function fFrames(){
this.top=window.parent;
for(var i=0;i<window.parent.frames.length;i++){
if(window.parent.frames[i].name){
this[window.parent.frames[i].name]=window.parent.frames[i];
}
}
}
function fUpdateModule(_53){
MM[_53].load=false;
if(GE.laterRequestModule==_53){
GE.laterRequestModule="";
MM.getModule(_53);
}
}
function fModuleUpdated(_54){
fResetTab(_54);
if(GE.laterRequestModule==_54){
if(MM[_54].load){
MM.showToolbar(_54);
}
MM.getModule(_54);
}
}
function fModuleExecute(_55,_56){
Template.load(MM[_55].dependence||[],(_56&&_56.bind(MM[_55]))||fGetModule.bind(MM,_55));
}
function fGetModule(_57){
var _58=this[_57];
try{
if(_58.clone){
_58.index++;
var _59=_57+_58.index;
MM[_59]=new ModuleStatus("",_58.cach,_58.isFolder,_58.loadBeforeCM,_58.requestCM,_58.name,_58.tab,0,_58.icon);
fCloneFunc(_57,_59);
MM[_59].index=_58.index;
this[_59].clone=null;
GE.laterRequestModule=_59;
fGetCMFrame(_59);
_58.clone(_59);
if(_57!="outLink"){
GE.changeTab(_57);
}
return false;
}
UI.showWaiting(gLang.GLOBAL.tips_loading);
GE.changeTab(_57);
GE.laterRequestModule=_57;
if(!_58.load||!_58.cach){
if(!_58.requestCM||_58.loadBeforeCM){
this.createModule(_57);
}
if(_58.requestCM&&!CM.setCMReffer(_57)){
UI.hideWaiting();
fDebug("fGetModule["+_57+"]","Module not configed!");
return;
}
fResetTab(_57);
}else{
if(_58.load){
this.hideModules();
this.showModule(_57);
this.showToolbar(_57);
try{
_58.synData(_57);
_58.resize();
}
catch(exp){
}
UI.hideWaiting();
GE.addTab(_57);
HM.getHistory(_57);
fResetScroll();
if(_58.dg){
_58.dg.setDG();
_58.dg.focus();
}
fResetOutLink(_57);
}else{
UI.hideWaiting();
}
}
try{
if($("dvSignList")){
$("dvSignList").style.display="none";
}
}
catch(exp){
}
return false;
}
catch(exp){
fDebug("fGetModule",exp);
}
}
function fCreateModule(_5a){
try{
_5a=this.getRead(_5a);
if(!_5a){
return;
}
this.destroyModule(_5a);
var _5b=this[_5a];
if(_5b.isFolder){
fCloneFunc("folder",_5a);
}
_5b.div=fCreateModuleDiv(_5a);
try{
_5b.div.innerHTML=_5b.getHtml();
_5b.init();
}
catch(e){
fDebug("fCreateModule["+_5a+":getHtml]",e);
return;
}
_5b.load=true;
if(_5a!=GE.laterRequestModule&&GE.laterRequestModule!=""){
_5b.div.style.display="none";
return;
}
if(GE.readOperating&&_5a.indexOf("letter")>-1){
UI.Tab.change(MM["read"].operateRead,CM["letter"][_5a].data.subject,_5a);
MM["read"].operateRead=null;
UI.Tab.exist(_5a).onclick();
}else{
GE.addTab(_5a);
}
GE.readOperating=false;
this.hideModules();
this.showModule(_5a);
this.showToolbar(_5a);
UI.hideWaiting();
fResetScroll();
_5b.resize();
if(!GE.IsIE){
window.setTimeout("HM.getHistory( '"+_5a+"' )",200);
}else{
HM.getHistory(_5a);
}
}
catch(exp){
fDebug("fCreateModule",exp);
}
}
function fCreateModuleDiv(_5c){
var _5d=$("dvRightBottom");
var div=El.createElement("DIV");
div.id="div"+_5c;
_5d.insertBefore(div,$("dvCopyright"));
return div;
}
function fDestroyModule(_5f){
var _60=this[_5f];
try{
if(!_60.div){
return;
}
var _61=$("dvRightBottom");
_60.div.innerHTML="";
if(_61==_60.div.parentNode){
_61.removeChild(_60.div);
}
_60.load=false;
}
catch(e){
fDebug("fDestroyModule",e);
}
}
function fGetRead(_62){
try{
if(!GE.isLetterDbClick&&_62=="read"){
_62=false;
fRead_initPanel(GE.currentFolder);
var _63=GE.currentFolder;
UI.hideWaiting();
}else{
if(GE.isLetterDbClick&&_62=="read"){
_62="letter"+MM["read"].index;
MM["read"].index++;
MM[_62]=new ModuleStatus("",true,0,false,true,CM["read"].subject,0,0,"readIco");
fCloneFunc("read",_62);
CM[_62]=CM["read"];
}else{
if(GE.isLetterDbClick&&_62.indexOf("letter")>-1){
MM[_62]=new ModuleStatus("",true,0,false,true,CM["letter"][_62].data.subject,0,0,"readIco");
fCloneFunc("read",_62);
}
}
}
}
catch(exp){
fDebug("fGetRead",exp);
}
return _62;
}
function fShowModule(_64){
try{
this[_64].div.style.display="";
}
catch(exp){
fDebug("fShowModule",exp);
}
}
function fHideModules(){
try{
for(var o in this){
if(typeof (this[o])=="object"&&this[o]&&this[o].div){
if(this[o].div.style.display!="none"){
this[o].div.style.display="none";
}
}
}
}
catch(e){
fDebug("fHideModules",e);
}
}
function fShowToolbar(_66){
UI.Toolbar.show(_66,MM[_66].getToolbar(_66));
}
function fGetCMFrame(_67){
var frm=frame["contentFrame"];
if(!frm.document.getElementById(_67)){
var div=frm.document.createElement("DIV");
div.innerHTML="<iframe id='"+_67+"' name='"+_67+"'></iframe>";
frm.document.body.appendChild(div);
}
return frm.document.getElementById(_67);
}
function fFrameUrlReffer(frm,url){
try{
if(url.indexOf("?")>-1){
frm.src=url+"&"+Math.round(Math.random()*1000);
}else{
frm.src=url+"?"+Math.round(Math.random()*1000);
}
}
catch(e){
fDebug("fFrameUrlReffer",e);
}
}
function fGetHistory(_6c){
if(_6c!=HM.arrHistory[HM.arrHistory.length-1]){
HM.arrHistory[HM.arrHistory.length]=_6c;
}else{
return;
}
HM.isHistory=false;
fRefreshHistory();
}
function fRefreshHistory(){
try{
var _6d=frame["historyFrame"].location.href;
if(_6d.indexOf("history_1.htm")!=-1){
_6d=_6d.replace("history_1.htm","history_2.htm");
}else{
_6d=_6d.replace("history_2.htm","history_1.htm");
}
frame["historyFrame"].location.href=_6d;
}
catch(e){
HM.isHistory=false;
fDebug("fRefreshHistory",e);
}
}
function fGoHistory(){
if(!HM.isHistory){
HM.isHistory=true;
return;
}
if(HM.arrHistory.length<2){
HM.isHistory=false;
}else{
var _6e=HM.arrHistory[HM.arrHistory.length-2];
MM.getModule(_6e);
HM.arrHistory.length=HM.arrHistory.length-2;
HM.isHistory=false;
}
fRefreshHistory();
}
function fGetInitModules(){
try{
for(var i=0;i<gInitModules.length;i++){
if(gInitModules[i]=="compose"){
try{
if(!MM[gInitModules[i]].load){
MM.createModule("compose");
GE.composeType="compose";
window.setTimeout("CM.setCMReffer('"+gInitModules[i]+"')",i*1000);
}
}
catch(exp){
fDebug("fGetInitModules[get compose]",exp);
}
}else{
if(!MM[gInitModules[i]].load){
window.setTimeout("CM.setCMReffer('"+gInitModules[i]+"')",i*1000);
}
}
}
}
catch(e){
fDebug("fGetInitModules",e);
}
}
function fDoubleCheckModule(_70){
if(MM[_70].div){
if(MM[_70].div.style.display==""){
return true;
}else{
return false;
}
}
}
function fResetScroll(){
return;
$doc().body.scrollTop=0;
}
function fGetFirstPage(){
try{
var _71=CC.getCookie("ntes_mail_firstpage");
if(_71){
if(_71=="netfolder"){
if(!CC.User.supportNetfolder){
}
MM.execute("nf");
}
}else{
if(CM.User.attrs.firstpage==1){
MM.getModule("inbox");
}
}
}
catch(exp){
}
}
function fGetThis(){
return this.oThis;
}
function fGetEvent(){
if(GE.IsIE){
return $win().event;
}else{
return this.oEvent;
}
}
function fSetFullDisplay(){
$("dvRightBottom").oldMarginLeft=$("dvRightBottom").style.marginLeft;
$("dvRightBottom").style.marginLeft=El.getX($("dvHide2"))+$("GlTabs").offsetWidth-4+"px";
GE.isFullDisplay=true;
}
function fSetNavDisplay(){
$win().wObserve("resize",function(){
GE.setPartHeight();
GE.setLeftHeight();
$win().fHSplitterMove(0);
var _72=GE.laterRequestModule;
MM[_72].resize();
if(MM[_72].isFolder){
$win().vSplitterMove(0);
}
CC.resetNavScroll();
});
GE.setPartHeight();
try{
GE.setLeftHeight();
$("dvRightBottom").style.marginLeft="206px";
$("dvRightBottom").style.height="";
$win().fHSplitterMove(GE.localConfig["con_left_width"]||0);
}
catch(exp){
fDebug("fSetNavDisplay",exp);
}
}
GE.setPartHeight=function(){
this.bodyHeight=$doc().body.clientHeight;
this.bodyWidth=$doc().body.clientWidth;
this.leftHeight=this.bodyHeight-106-22;
if(!document.all){
this.leftHeight-=2;
}
};
GE.setLeftHeight=function(){
GE.setPartHeight();
var h=GE.bodyHeight-El.getY($("dvLeftBottom"))-5;
if(document.all){
h+=2;
}
$("dvLeftBottom").style.height=h+"px";
$("dvLeftBottom_1").style.height=h-2+"px";
var _74=Math.max(1,$("liContainer").offsetTop)+"px";
for(var i=0;i<gApps.length;i++){
if(gApps[i].tree){
$(gApps[i].tree).style.height=_74;
}
}
$("divHSpliiter2").style.height=h+"px";
};
function fSetTabMenu(){
CMenu.init();
UI.Tab.init();
$win().CMenu=CMenu;
UI.Tab.call[0]=function(_76){
MM[_76].close=true;
};
UI.Tab.call[1]=function(_77){
if(GE.laterRequestModule!=_77){
MM.getModule(_77);
}
MM[_77].close=false;
};
UI.Tab.call[2]=function(_78){
return MM[_78].exit();
};
UI.Tab.text=[gLang.GLOBAL["tab_closetips"]];
}
function fChangeTab(_79){
try{
$("dvLeftBottom_1").style.overflow="hidden";
if(_79=="read"){
_79=GE.currentFolder;
}else{
if(_79.indexOf("letter")>-1&&CM[_79]&&MM[_79]){
_79=CM[_79].getFolder();
}
}
UI.TreeView.setActive(MM[_79].getLinkId(_79));
if($("dvHide3").style.display=="none"){
$("dvHide3").style.display="block";
$("dvRightBottom").style.marginLeft=$("dvRightBottom").oldMarginLeft;
GE.isFullDisplay=false;
}
if(_79=="outLink"){
return;
}
var _7a=MM[_79].tab;
var _7b=(gApps[_7a]&&gApps[_7a].lbl)?_7a:0;
var _7c=(gApps[_7a]&&gApps[_7a].tree)?_7a:0;
for(var i=0;i<gApps.length;i++){
var obj;
if(obj=$(gApps[i].lbl)){
((i==_7b)?Element.addClassName:Element.removeClassName)(obj,"active");
}
if(obj=$(gApps[i].tree)){
((i==_7c)?Element.show:Element.hide)(obj);
}
}
}
catch(exp){
fDebug("fChangeTab["+_79+"]",exp);
}
}
function fAddTab(_7f){
var tab=UI.Tab.exist(_7f);
if(tab){
fResetTab(_7f);
tab.onclick();
}else{
UI.Tab.add({icon:MM[_7f].icon,name:_7f,group:MM[_7f].group,close:(_7f=="welcome"),text:fGetTabTitleHTML(_7f)});
if(MM[_7f].isRealFolder()){
tab=UI.Tab.exist(_7f);
tab.onmouseover=function(){
$win().fFolderOver($("lnk"+_7f));
};
tab.onmouseout=function(){
$win().fFolderOut($("lnk"+_7f));
};
}
}
}
function fGetTabTitleHTML(_81){
return "<b class=\"chaCn fgy\">"+MM[_81].getName()+"</b> "+"<span class=\"chaCn fgy\">"+MM[_81].getNamePad()+"</span>";
}
function fResetTab(_82){
var tab=UI.Tab.exist(_82);
if(tab){
UI.Tab.icon(_82,MM[_82].icon);
UI.Tab.title(_82,fGetTabTitleHTML(_82));
}
}
function fResetFolderTabs(){
for(var _84 in UI.Tab.tabs){
if(MM[_84]&&MM[_84].isRealFolder()){
if(CM.MBOX.getFolderItem(fGetFidByModuleName(_84))){
fResetTab(_84);
}else{
fUnregisterModule(_84);
}
}
}
}
function fUnregisterModule(_85){
UI.Tab.close(_85);
MM.destroyModule(_85);
delete MM[_85];
delete CM[_85];
delete gInboxFlag[_85];
}
function fCloneFunc(m1,m2){
for(var o in MM[m1]){
if(typeof (MM[m1][o])=="function"){
MM[m2][o]=MM[m1][o];
}
}
MM[m2]["moduleName"]=m2;
}
function fResetOutLink(_89){
if(_89.indexOf("outLink")>-1){
var _8a=$win().frames[_89];
if(_8a.location.href.endsWith("history_1.htm")){
$(_89).src=MM[_89].cmURL;
}
}
}
function fCommon_resize(){
this.div.firstChild.style.height=GE.leftHeight+"px";
}
MM["folder"]={};
CC.getCookie=fCommon_getCookie;
CC.setCookie=fCommon_setCookie;
CC.getAjaxMsg=fCommon_getAjaxMsg;
CC.getModuleByFid=fGetModuleByFid;
CC.getFidByModule=fGetFidByModuleName;
CC.getOutLink=fGetOutLink;
CC.getOutLink_new=fGetOutLink_new;
CC.getMidByArr=fGetMidByArr;
CC.getMidByUrl=fGetMidByUrl;
CC.getMidByComposeModule=fGetMidByComposeModule;
CC.getMidByForwardModule=fGetMidByForwardModule;
CC.getTips=fGetTips;
CC.refleshOutlinkHistory=fCommon_refleshOutlinkHistory;
CC.resetNavScroll=fCommon_resetNavScroll;
CC.getRndSysSign=fGetRndSysSign;
CC.showSysSignByOption=fShowSysSignByOption;
function fGetClientInfo(){
try{
var _8b=navigator.userAgent;
var _8c=screen.height;
var _8d=screen.width;
gDebugInfo="System Infomation: "+_8b+" -- Srceen: "+_8d+"*"+_8c+" -- ";
gDebugInfo+="UID: "+GE.UID+" -- ";
}
catch(e){
fDebug("fGetClientInfo",e);
}
}
function fGetUserAgen(){
var _8e=window.navigator.userAgent;
var _8f="";
var _90="";
if(_8e.indexOf("MSIE")>-1){
_8f="msie";
_90=_8e.replace(/.+MSIE/gi,"").replace(/;.+/gi,"")-0;
}else{
if(_8e.toUpperCase().indexOf("FIREFOX")>-1){
_8f="firefox";
_90=_8e.replace(/.+Firefox\//gi,"").replace(/\(.*\)/g,"")-0;
}else{
if(_8e.toUpperCase().indexOf("NETSCAPE")>-1){
_8f="netscape";
_90=_8e.replace(/.+NETSCAPE\//gi,"").replace(/\(.*\)/g,"")-0;
}
}
}
gAppName=_8f;
gVersion=_90;
}
function fCommon_getAjaxMsg(_91){
if(CC.debug){
try{
var win=window.open(CC.getURL("blankpage.html"),"_blank","width=640,height=480,resizable=1");
setTimeout(function(){
win.document.title="Error Report";
win.document.body.style.margin="5px";
win.document.body.innerHTML=""+"<textarea style=\"width:100%;height:100%\" readonly>"+_91.htmlencode()+"</textarea>"+"<input type=\"button\" value=\"Close\" onclick=\"window.close()\"  style=\"position:absolute;right:32px;bottom:30px;\" />";
},100);
}
catch(ex){
alert(ex);
}
return;
}
var doc=window.parent.frames["debugFrame"].document;
if(!doc.getElementById("ifrm")){
var div=doc.createElement("DIV");
div.innerHTML="<iframe id='ifrm'></iframe>";
doc.getElementsByTagName("BODY")[0].appendChild(div);
}
var _95=doc.getElementById("ifrm");
if(fCommon_getAjaxMsg.lastInfo!=_91){
}
fCommon_getAjaxMsg.lastInfo=_91;
}
CC.getNewMailCount=function(){
MBOX_reload();
};
function fCommon_getCookie(_96){
var _97=_96+"=";
var ck=document.cookie;
if(ck.length>0){
var _99=ck.indexOf(_97);
if(_99!=-1){
_99+=_97.length;
var end=ck.indexOf(";",_99);
if(end==-1){
end=ck.length;
}
return unescape(ck.substring(_99,end));
}
}
return "";
}
function fCommon_setCookie(_9b,_9c){
document.cookie=_9b+"="+escape(_9c)+";domain="+getDomain(location.host)+";expires="+(new Date(2099,12,31)).toGMTString();
function getDomain(_9d){
var i=_9d.indexOf(".");
if(i==-1||_9d.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)){
return _9d;
}else{
if(_9d.split(".",3).length>=3){
return _9d.substring(i+1);
}
}
return _9d;
}
}
function fGetModuleByFid(fid,_a0){
for(var o in gInboxFlag){
if(gInboxFlag[o]==fid){
if(_a0!==undefined){
MM[o].name=_a0;
}
return o;
}
}
try{
MM["defined"+fid]=new ModuleStatus("f:CM$LoadFolder("+fid+")",true,1,false,true,_a0,0,0,"icoMfd");
gInboxFlag["defined"+fid]=fid;
return "defined"+fid;
}
catch(e){
fDebug("fGetModuleByFid",e);
}
}
function fGetFidByModuleName(_a2){
switch(_a2){
case "unRead":
return 0;
case "inbox":
return 1;
case "draft":
return 2;
case "sended":
return 3;
case "deleted":
return 4;
default:
return parseInt(_a2.replace(/defined/g,""),10);
}
}
function fGetOutLink_new(_a3,_a4,_a5,_a6){
if(!GE.outLink[_a4]){
MM["outLink"].name=_a5;
MM["outLink"].cmURL=_a3;
MM["outLink"].tab=_a6;
if(_a4=="blog"){
MM["outLink"].icon="blogIco";
}
var _a7=CC.getOutLink(_a3,"");
MM[_a7].cmURL=_a3;
MM["outLink"].icon="serIco";
GE.outLink[_a4]=_a7;
return _a7;
}else{
var _a7=GE.outLink[_a4];
MM.getModule(_a7);
return false;
}
}
function fGetOutLink(_a8,m){
MM["outLink"].cmURL=_a8;
MM.getModule("outLink");
if(m!=""){
GE.changeTab(m);
}
return "outLink"+MM["outLink"].index;
}
MM["outLink"].index=0;
MM["outLink"].getHtml=fOutLink_getHtml;
MM["outLink"].init=fOutLink_init;
MM["outLink"].clone=fOutLink_clone;
MM["outLink"].getModuleByName=fOutLink_getModuleByName;
MM["outLink"].getNameByModule=fOutLink_getNameByModule;
function fOutLink_getHtml(){
var _aa="";
_aa+="<div class=\"border1\" style=\"height:238px; height:239px; overflow:hidden\" id=\"dvBorder"+this.moduleName+"\">";
_aa+="<iframe id=\""+this.moduleName+"\" src=\""+CC.getURL("history_1.htm")+"\" name=\""+this.moduleName+"\" border=\"0\" frameborder=\"0\" style=\"width:100%;height:100%;\"></iframe>";
_aa+="</div>";
return _aa;
}
function fOutLink_init(){
var _ab=this.moduleName;
var _ac=$(_ab);
if(this.cmURL!=""){
if(gVersion<=5.01&&GE.IsIE){
gFrm=_ac;
window.setTimeout("gFrm.src=\""+MM["outLink"].cmURL+"\"",100);
}else{
_ac.src=MM["outLink"].cmURL;
}
}
var h=GE.leftHeight;
this.div.firstChild.style.height=this.div.style.height=h+"px";
this.requestCM=true;
this.cach=true;
}
function fOutLink_clone(_ae){
MM[_ae].cmURL=this.cmURL;
MM.getModule(_ae);
}
function fOutLink_getModuleByName(_af){
return GE.outLink[_af];
}
function fOutLink_getNameByModule(){
for(var o in GE.outLink){
if(GE.outLink[name]==this.moduleName){
return name;
}
}
}
function fCommon_refleshOutlinkHistory(_b1){
if(!MM[_b1].loaded){
HM.isHistory=false;
fRefreshHistory();
MM[_b1].loaded=true;
}
}
function fOpenSendMDNDialog(_b2){
var _b3=_b2.getMimeInfo();
return new UI.Dialog({title:gLang.read.getrec.title,body:fGetBody(),textOK:gLang.read.getrec.btn_send,textCancel:gLang.read.getrec.btn_discard,actions:[buttonClicked.bind(null,true),buttonClicked.bind(null,false)]});
function fGetBody(){
return "<form>"+"<div class=\"mid_msg hadRead\">"+"<div class=\"hrMsg\">"+"<div class=\"fgn hrMsgPrt\">"+gLang.read.getrec["qry"]+"</div>"+"<div class=\"fgy hrMsgPrt\"><input name=\"setasthistime\" type=\"checkbox\" value=\"1\">"+gLang.read.getrec["always"]+"</div>"+"</div>"+"</div>"+"</form>";
}
function buttonClicked(_b4,_b5){
var _b6=_b4?2:1;
if(_b5.setasthistime.checked){
var req={"attrs":{"op_readreceipt":_b6}};
new CMXClient().simpleCall("user:setAttrs",req,function(){
CM.User.attrs.op_readreceipt=_b6;
});
}
if(_b4){
_b2.doSendMDN();
}
}
}
function fGetMidByArr(arr){
for(var i=0;i<arr.length;i++){
if(arr[i].indexOf("mid=")>-1){
return arr[i];
}
}
return "";
}
function fGetMidByUrl(str){
str=str.usc_hdc();
if(str.substr(0,2)=="f:"){
var p1=str.indexOf("'");
var p2=str.indexOf("'",p1+1);
if(p1>0&&p2>0){
return str.substr(p1+1,p2-p1-1);
}
}else{
var i=str.indexOf("?mid=");
if(i==-1){
i=str.indexOf("&mid=");
}
if(i!=-1){
return str.substring(i+5,str.indexOf("&",i+5));
}
}
return str;
}
function fGetMidByComposeModule(_be){
var _bf=MM["read"].midReplyMapping;
for(var o in _bf){
if(_bf[o]==_be){
return o;
}
}
}
function fGetMidByForwardModule(_c1){
var _c2=MM["read"].midForwardMapping;
for(var o in _c2){
if(_c2[o]==_c1){
return o;
}
}
}
CC.getContextMenu=function fCommon_getContextMenu(_c4,_c5,_c6){
try{
var o=[{top:Event.pointerY(_c6),left:Event.pointerX(_c6)}];
var _c8=_c5.id;
var _c9=gApps.pluck("tree").indexOf(_c4);
if(_c9!=-1){
gApps[_c9].buildContextMenu(o,_c8);
}
if(o.length>1){
CMenu.create(o);
}
}
catch(exp){
fDebug("CC.getContextMenu",exp);
}
};
function fGetTips(){
return "<div class=\"tipMsg fgy\" id=\"divTipMsg\"><b class=\"btnS icoTipMsg\"></b>"+gLang.help.tips_today+fSelectTips()+"</div>";
}
function fSelectTips(){
var len=gTips.length;
var _cb=Math.round(Math.random()*(len-1));
return gTips[_cb];
}
function fCommon_resetNavScroll(){
var _cc=$("dvLeftBottom_1");
if(_cc.scrollHeight>_cc.offsetHeight+5){
_cc.style.overflow="auto";
}else{
_cc.style.overflow="hidden";
}
}
function fShowSysSignByOption(id){
if(!MM[id].sigFrame){
return;
}
var win=MM[id].sigFrame.parent;
win.fGetSignList(id,"380px","300px");
}
function fGetRndSysSign(id){
try{
if(!MM[id].sigFrame){
return;
}
var doc=MM[id].sigFrame.document;
var _d1=doc.getElementsByTagName("XMP")[0].innerHTML;
var arr=_d1.replace(/\s/g,"").split("|");
var len=arr.length;
var _d4=Math.round(Math.random()*(len-1));
MM[id].fillContent(arr[_d4]);
}
catch(exp){
fDebug("fGetRndSysSign",exp);
}
}
function fGoCompose(o){
MM.execute("compose",function(){
fGoComposeImp(o);
});
}

function sizeAuto(i,_2){
if(i>=1073741824){
return formatWithDivide(i,1073741824,"#")+" G";
}else{
if(i>=1048576){
return formatWithDivide(i,1048576,"#")+" M";
}else{
if(i>=1024){
return formatWithDivide(i,1024,"#")+" K";
}else{
return i+" B";
}
}
}
}
function sizeG(i,_4){
if(i>=0){
return formatWithDivide(i,1073741824)+" G";
}else{
return i;
}
}
function sizeM(i,_6){
if(i>=0){
return formatWithDivide(i,1048576,_6)+" M";
}else{
return i;
}
}
function sizeK(i,_8){
if(i>=0){
return formatWithDivide(i,1024,_8)+" K";
}else{
return i;
}
}
function formatSizeFull(i){
return sizeAuto(i)+" ("+formatBytes(i)+")";
}
function formatBytes(i){
return formatDigit(i,"#")+" "+gLang.GLOBAL["byte"];
}
function formatNumber(i){
return formatDigit(i,"#");
}
function formatWithDivide(i,_d,_e){
return formatDigit(Math.round(i/_d*100)/100,_e);
}
function formatDigit(i,_10){
if(!_10){
_10="#,##0.00";
}
var _11=0,forceFraction=false;
var dot=_10.lastIndexOf(".");
if(dot!=-1){
_11=_10.length-(dot+1);
forceFraction=(_10.charAt(dot+1)=="0");
}
var s=i.toString();
if(i>=0){
var k=s.indexOf(".");
if(k<0){
k=s.length;
if(forceFraction){
s+=".";
}
}else{
if(_11>=0){
var l=Math.min(k+_11,s.length-1);
s=s.substr(0,(l>k)?(l+1):l);
}
}
if(forceFraction){
for(var j=s.length;j<=k+_11;j++){
s+="0";
}
}
var j=(k-1)%3+1;
var s1=s.substr(0,j);
for(;j<s.length;j+=3){
if(j==k){
j++;
s1+=".";
}else{
s1+=",";
}
s1+=s.substr(j,3);
}
return s1;
}else{
return s;
}
}
(function(){
window.datetimeAuto=datetimeAuto;
function datetimeAuto(_18){
var _19=new Date();
var _1a=_19.getTimezoneOffset();
var _1b=parseInt(CM.User.attrs.time_zone,10);
_19.setTime(_19.getTime()+(_1b*3600*1000)+(_1a*60*1000));
if(_18.getFullYear()==_19.getFullYear()){
if(_18.getMonth()==_19.getMonth()&&_18.getDate()==_19.getDate()){
return timeformat_hh_mm_24(_18);
}else{
return dateformat_MM_dd(_18);
}
}else{
return _18.formatDate();
}
}
Date.prototype.formatDate=function(){
return this.getFullYear()+"-"+dateformat_MM_dd(this);
};
function dateformat_MM_dd(_1c){
return (_1c.getMonth()<9?"0":"")+(_1c.getMonth()+1)+"-"+(_1c.getDate()<10?"0":"")+(_1c.getDate());
}
Date.prototype.formatTime=function(){
return (this.getHours()<10?"0":"")+(this.getHours())+":"+(this.getMinutes()<10?"0":"")+(this.getMinutes())+":"+(this.getSeconds()<10?"0":"")+(this.getSeconds());
};
function timeformat_hh_mm_24(_1d){
return _1d.getHours()+":"+(_1d.getMinutes()<10?"0":"")+_1d.getMinutes();
}
function timeformat_h_mm(_1e){
var _1f=gLang.date[(_1e.getHours()<12)?"amP":"pmP"];
var h=(_1e.getHours()<12)?_1e.getHours():(_1e.getHours()-12);
return String.format(_1f,h+":"+(_1e.getMinutes()<10?"0":"")+(_1e.getMinutes()));
}
Date.prototype.formatDateTime=function(){
return this.formatDate()+" "+this.formatTime();
};
Date.prototype.formatPack=function(){
return (this.formatDate()+this.formatTime()).replace(/[- :]/g,"");
};
Date.parseDate=function(_21){
var i1=_21.indexOf("-");
var i2=_21.indexOf("-",i1+1);
if(i1<0||i2<0){
return null;
}
var _24=parseInt(_21.substring(0,i1),10);
var _25=parseInt(_21.substring(i1+1,i2),10)-1;
var _26=parseInt(_21.substring(i2+1),10);
var _27=0;
var _28=0;
var _29=0;
var _2a=0;
var i3=_21.indexOf(" ",i2+1);
var i4=_21.indexOf(":",i3+1);
if(i3>0&&i4>0){
_27=parseInt(_21.substring(i3+1,i4),10);
var i5=_21.indexOf(":",i4+1);
var i6=_21.indexOf(".",i5+1);
_28=parseInt(_21.substring(i4+1,i5),10);
if(i6>0){
_29=parseInt(_21.substring(i5+1,i6),10);
_2a=1000*("0"+_21.substr(i6));
}else{
_29=parseInt(_21.substring(i5+1),10);
}
}
if(isNaN(_24)||isNaN(_25)||isNaN(_26)||isNaN(_27)||isNaN(_28)||isNaN(_29)||isNaN(_2a)){
return null;
}
var _2f=new Date(_24,_25,_26,_27,_28,_29,_2a);
_2f.setFullYear(_24);
return _2f;
};
})();
function isEmailAddr(_30){
var _31=_30.replace(/[^\x00-\xff]/g,"A");
return /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(_31);
}
String.prototype.stripPartLinks=function(){
return this.replace(/<img[^>]*mbox:getMessageData[^>]*>?/gi,"").replace(/"[^"]*mbox:getMessageData[^"]*"/g,"\"\"");
};
String.prototype.isIncludeChinese=function(){
return (this.length!=this.replace(/[^\x00-\xff]/g,"**").length);
};
(function(){
var _32={};
var _33=new String("unknown");
var _34=new String("text");
var _35=new String("msexcel");
_32["text/plain"]=_34;
_32["text/css"]="text";
_32["text/javascript"]="text";
_32["text/html"]="ie";
_32["text/xml"]="xml";
_32["text/csv"]="csv";
_32["text/x-vcard"]="vcf";
_32["application/hta"]="ie";
_32["application/xml"]="xml";
_32["application/pdf"]="pdf";
_32["application/msaccess"]="msaccess";
_32["application/msword"]="msword";
_32["application/x-msexcel"]=_35;
_32["application/vnd.ms-excel"]=_35;
_32["application/x-mspowerpoint"]="mspowerpoint";
_32["application/vnd.ms-powerpoint"]="mspowerpoint";
_32["application/x-csh"]="system";
_32["application/x-sh"]="system";
_32["application/java-archive"]="archive";
_32["application/x-compress"]="archive";
_32["application/x-gzip"]="archive";
_32["application/x-tar"]="archive";
_32["application/x-zip-compressed"]="archive";
_32["application/zip"]="archive";
_32["message/rfc822"]="rfc822";
_34["bat"]="system";
_34["ini"]="conf";
_34["inf"]="conf";
_34["csv"]="csv";
_34["vcf"]="vcf";
_35["csv"]="csv";
Object.extend(Object.extend(_33,_34),_35);
_33["psd"]="image";
_33["ra"]="media";
_33["rm"]="media";
_33["rmvb"]="media";
_33["rar"]="archive";
_33["tgz"]="archive";
_33["gz"]="archive";
_33["arj"]="archive";
_33["lzh"]="archive";
_33["exe"]="system";
_33["dll"]="system";
_33["sys"]="system";
window.getIconSpec=function(_36,_37){
var x=_32[_37];
if(x){
}else{
if(_37.startsWith("image/")){
x="image";
}else{
if(_37.startsWith("audio/")){
x="media";
}else{
if(_37.startsWith("video/")){
x="media";
}else{
x=_33;
}
}
}
}
return x[_36.getSuffix().toLowerCase()]||x;
};
window.getTypeDesc=function(_39,_3a){
var t=gLang.filetypedesc;
if(t[_3a]){
return t[_3a];
}
var _3c=_32[_3a];
if(_3c){
}else{
if(_3a.startsWith("image/")){
_3c="image";
}else{
if(_3a.startsWith("audio/")){
_3c="audio";
}else{
if(_3a.startsWith("video/")){
_3c="video";
}else{
_3c=_33;
}
}
}
}
var ext=_39.getSuffix();
_3c=_3c[ext.toLowerCase()]||_3c;
ext=(ext.length<4)?ext.toUpperCase():"";
return (ext&&t["%"+_3c]&&ext+" "+t["%"+_3c])||t[_3c]||t["%"+_3c]||(ext+" "+t["%unknown"]);
};
})();
function getIcon48(_3e){
return CC.getURL("images/icon48/"+_3e+".gif");
}
function fUpdateSelection(_3f,idx,_41,_42,_43){
var _44=0;
var _45=0;
if(_43==null||_43==false){
_45=1;
var o=El.createElement("option");
o.value="";
o.text=gLang.select_na;
_3f.length=_41.length+_45;
_3f.options[_44++]=o;
}else{
_3f.length=_41.length+_45;
}
for(var i=0;i<_41.length;i++){
var _48=_41[i];
if(_42){
_48=_48[_42];
}
var o=El.createElement("option");
o.value=i;
o.text=_48;
_3f.options[_44++]=o;
}
idx=parseInt(idx);
if(idx>=0&&idx<_41.length){
idx=idx+_45;
}else{
idx=0;
}
_3f.options[idx].selected=true;
}
function getInnerText(_49,_4a){
function empty(){
return "";
}
if(!_49||!_49.childNodes){
return "";
}
_4a=_4a?_4a:{};
var str="";
var _4c=_49.childNodes;
if(_49.tagName=="PRE"){
_4a.preLevel=_4a.preLevel!=undefined?_4a.preLevel+1:1;
}
str+=(_4a.before||empty)(_49);
for(var i=0;i<_4c.length;i++){
if(_4c[i].nodeType==1){
if(_4c[i].tagName=="BR"||_4c[i].tagName=="P"||_4c[i].tagName=="BLOCKQUOTE"||(_4c[i].tagName=="DIV"&&_4c[i].innerHTML!="")){
str+="\n"+(_4a.afterNewLine||empty)(_49,i);
}
str+=getInnerText(_4c[i],_4a);
}else{
if(_4c[i].nodeType==3){
if(!_4a.preLevel||_4a.preLevel<=0){
str+=_4c[i].nodeValue.rmNewLine().trim();
}else{
var val=_4c[i].nodeValue;
val=val.replace(/\r/g,"\n");
var idx=-1;
while((idx=val.indexOf("\n"))>-1){
str+=val.substr(0,idx)+"\n"+(_4a.afterNewLine||empty)(_49,i);
val=val.substr(idx+1);
}
str+=val;
}
}
}
}
if(_49.tagName=="PRE"){
_4a.preLevel=_4a.preLevel-1;
}
str+=(_4a.after||empty)(_49);
return str;
}
String.prototype.rmNewLine=function(){
return this.replace(/\n|\r/g,"");
};
function changeHtmlToText(){
var _50="";
this.before=function(_51){
if(_51&&_51.tagName=="BLOCKQUOTE"){
_50+="> ";
}
return "";
};
this.after=function(_52){
if(_52&&_52.tagName=="BLOCKQUOTE"){
_50=_50.replace("> ","");
}
return "";
};
this.afterNewLine=function(_53,_54){
var _55=_50;
try{
_55+=_53.childNodes[_54].tagName=="BLOCKQUOTE"?"> ":"";
}
catch(e){
}
return _55;
};
}
function fComposeAllEmpty(){
var _56="compose";
return !MM[_56]||!MM[_56].allEmpty||MM[_56].allEmpty();
}
function disableElements(){
for(var i=0;i<arguments.length;i++){
$(arguments[i]).disabled=true;
}
}
function enableElements(){
for(var i=0;i<arguments.length;i++){
$(arguments[i]).disabled=false;
}
}

function EmailAddress(_1){
this._personal=EmailAddress.getTrueName(_1);
this._address=EmailAddress.parseSingleEmail(_1);
}
EmailAddress.prototype={getPersonal:function(){
return this._personal;
},getAddress:function(){
return this._address;
},toString:function(){
if(this._personal){
return this._personal+" <"+this._address+">";
}else{
return this._address;
}
}};
Object.extend(EmailAddress,{getTrueName:function(_2){
if(!_2){
return "";
}
var p=_2.indexOf("<");
if(p>-1){
return _2.substr(0,p).trim().replace(/["']/g,"");
}
return "";
},getEmail:function(_4){
if(!_4){
return "";
}
_4.replace(/\s/gi,"");
var _5=_4.lastIndexOf("<");
var _6=_4.lastIndexOf(">");
if(_5>=0&&_6>=0&&_6>_5){
return _4.substring(_5+1,_6);
}else{
if(_5>=0||_6>=0){
return "";
}else{
return _4;
}
}
},checkNoNamePart:function(_7){
_7.toLowerCase();
_7.replace(/\s/gi,"");
if(_7.search("@")<0){
return "";
}
return _7;
},parseSingleEmail:function(_8){
var _9=EmailAddress.getEmail(_8);
return _9?EmailAddress.checkNoNamePart(_9):"";
},parse0:function(_a){
var _b=[];
var _c=getQuotePairs(_a);
var _d=_c.length;
var _e=0;
var _f=0;
for(var i=0;;){
var pos=getPos(_a,_f);
if(pos==-1){
_b[_b.length]=_a.substr(_e).trim();
return _b;
}else{
if(i<_d){
var _12=_c[i];
var _13=_12.index;
var _14=_12.lastIndex||(_12.index+_12[0].length-1);
if(pos<_13||pos>_14){
_b[_b.length]=_a.substring(_e,pos).trim();
_e=pos+1;
if(pos>_14){
i++;
}
}
_f=pos+1;
}else{
_b[_b.length]=_a.substring(_e,pos).trim();
_f=_e=pos+1;
}
}
}
function getQuotePairs(_15){
var _16=[],_12;
var _17=new RegExp("\"[^\"]*\"","g");
while((_12=_17.exec(_15))!=null){
_16[_16.length]=_12;
}
return _16;
}
function getPos(_18,_19){
var _1a=_18.indexOf(",",_19);
var _1b=_18.indexOf(";",_19);
var min=_1a<_1b?_1a:_1b;
if(min==-1){
min=_1a>_1b?_1a:_1b;
}
return min;
}
},parse:function(_1d){
var _1e=EmailAddress.parse0(_1d);
for(var i=0;i<_1e.length;i++){
var _20=new EmailAddress(_1e[i]);
if(_20.getAddress()==""){
_20._address=_1e[i];
}
_1e[i]=_20;
}
return _1e;
},checkInput:function(_21){
if(_21.match(/^\"?([^\"]?(\\\")?)*\"?\s*\<?[^ \t\n\r()<>,;:\\\"\[\]@]+@?[^ \t\n\r()<>,;:\\\"\[\]@]*\>?$/)!=null){
var sq=_21.replace(/\\\"/g,"").split("\"");
if(sq.length!=3&&sq.length!=1){
return false;
}
var str=_21.substring(_21.lastIndexOf("\""));
var _24=str.indexOf("<");
var _25=str.indexOf(">");
if((_24!=-1&&_25==-1)||(_24==-1&&_25!=-1)||_24>_25){
return false;
}
return true;
}
return false;
},checkAddress:function(_26){
return _26.match(/^[^ \t\n\r()<>,;:\\\"\[\]@]+@[^ \t\n\r()<>,;:\\\"\[\]@]+$/)!=null;
},format:function(s){
return s.trim().replace(/[ ,;]*$/i,"");
}});

function CMXClient(){
}
(function(){
Ajax.Responders.register({onException:function(_1,_2){
var s=_1.funcId?"func="+_1.funcId:"url="+_1.url;
fDebug("Ajax.onException|"+s,_2);
},onComplete:function(_4,_5,_6){
UI.hideWaiting();
if(_4.responseIsFailure()){
var _7="";
try{
_7="HTTP "+_5.status+" "+_5.statusText;
}
catch(ex){
}
showFailed(_4,null,_7);
}
}});
function showFailed(_8,_9,_a){
_8=_8||{};
_9=_9||{};
var _b=_8.funcId;
var _c=_8.requestVar;
var _d=_9["code"];
var _e=_9["messages"];
var _f=_b;
var _10=_d;
if(_10=="S_PARTIAL_OK"){
_10=_9["failCode"]||_10;
}
if(_b=="sequential"&&_c&&(_9["failIndex"]!=null)){
_f=_c.items[_9["failIndex"]].func;
}
var _11=false;
var _12;
if(_10&&_10.substring(0,3)=="FA_"){
var key=_10.substring(3);
for(var _14 in gLang.msg){
var map=gLang.msg[_14];
if(_14=="*"||typeof map!="object"){
continue;
}
if(_f.match(_14)){
_12=map[key]||_12;
}
}
if(_12){
_11=true;
}else{
_12=gLang.msg["*"][key];
}
}
_12=_12||gLang.msg.unknown;
var _16="<table><tr><td nowrap>"+_12+"</td><td align=\"right\" nowrap> &nbsp; <a href=\"javascript:fGoto();\"></a>"+"</td></tr>";
function addRow(_17,_18){
if(_17.endsWith(".var")){
_18="<a href='javascript:fGoto()' style='color:#666'"+" onclick='fToggle(this.nextSibling)'>(...)</a>"+"<pre style='display:none;margin:0;color:navy;overflow:auto;max-height:200px;'>"+varToXML(_18).htmlencode()+"</pre>";
}
_16+="<tr vAlign=top><td nowrap>"+_17+":&nbsp;</td><td nowrap>"+_18+"</td>";
}
_16+="<tr><td colspan=2 id='moreErrorInfo'><hr>";
_16+="<table>";
if(_f){
addRow(gLang.msg.dialog_label.func,_f);
}else{
if(_8.url){
addRow(gLang.msg.dialog_label.url,_8.url);
}
}
if(_10){
addRow(gLang.msg.dialog_label.code,_10);
}
if(_a){
addRow(gLang.msg.dialog_label.code,_a.escapeHTML());
}
_16+="</table>";
if(CC.debug){
_16+="<hr><table>";
for(var i in _8){
var _1a="";
if(i=="funcId"){
_1a="func";
}else{
if(i=="requestVar"){
_1a="var";
}else{
if(i=="url"){
_1a=i;
}
}
}
if(_1a){
addRow("request."+_1a,_8[i]);
}
}
for(var i in _9){
if(i!="messages"){
addRow("result."+i,_9[i]);
}
}
_16+="</table>";
}
if(_e&&_e.length>0){
_16+="<hr>"+gLang.msg.dialog_label.msgs+":<table>";
for(var i=0;i<_e.length;++i){
var msg=_e[i];
var l="";
if(msg.severity){
l+="["+msg.severity.substring(0,3)+"] ";
}
addRow(l+(msg.key||""),msg.summary);
}
_16+="</table>";
}
_16+="</td></tr></table>";
new UI.SysDialog({body:_16,init:function(_1d){
var _1e=_1d.getElementsByTagName("A")[0];
if(CC.debug||!_11){
_1e.onclick=toggleMore;
_1e.onclick();
}else{
El.hide($("moreErrorInfo"));
}
},action:function(){
if(_9.code=="FA_INVALID_SESSION"){
parent.location="/";
}
var _1f=$("dvLeftBottom_1").getElementsByTagName("input")[0];
if(_1f&&Element.hasClassName(_1f,"btnName")){
_1f.focus();
}
}});
function toggleMore(){
var _20=$("moreErrorInfo");
El.toggle(_20);
this.innerHTML=(Element.visible(_20)?"<<<":">>>").escapeHTML();
UI.Dialog.top().adjust();
}
}
CC.handleError=function(_21,_22,_23,_24,_25){
UI.hideWaiting();
showFailed({funcId:_21},_22);
};
CMXClient.getServletURL=function(){
return ajax_prefix+"s";
};
CMXClient.getPageURL=function(_26,cgi){
var url=ajax_prefix;
if(_26){
url=url+(_26.startsWith("/")?_26.substr(1):("XTS/"+_26))+"?sid="+encodeURIComponent(gSID);
return completeURL(url,cgi);
}
return url;
};
CMXClient.getURL=function(_29,cgi){
var url=CMXClient.getServletURL()+"?func="+_29+"&sid="+encodeURIComponent(gSID);
return completeURL(url,cgi);
};
function completeURL(url,cgi){
for(var key in cgi){
var val=$$A(cgi[key]);
for(var i=0;i<val.length;i++){
url+="&"+key+"="+encodeURIComponent(val[i]);
}
}
return url;
}
function submit(_31,_32,_33,_34){
_31.funcId=_32;
_31.requestVar=_33;
_34=_34||{};
var _35=_34.onSuccess||Prototype.emptyFunction;
_34.onSuccess=function(_36,_37){
_35(_36,_37);
if(!_31.handled){
_31.handleResult();
}
};
if(!UI.waiting){
UI.showWaiting(gLang.GLOBAL.tips_loading);
}
_31.initialize(CMXClient.getURL(_32,_31.cgi),_34);
}
Object.extend(Object.extend(CMXClient.prototype,Ajax.Request.prototype),{resultListener:Prototype.emptyFunction,handleResult:function(){
var _38=this.header("Content-Type")||"";
var _39,message;
if(_38.match(/^text\/javascript/i)){
_39=eval("(function() {return "+this.transport.responseText+"})()");
}else{
message="Unexpected Content-Type: "+_38;
}
if(_39){
this.result=_39;
var _3a=this.options["aj_"+_39.code];
if(_3a){
_3a(_39);
}else{
if(!this.resultListener(_39)){
showFailed(this,_39,null);
}
}
}
if(message){
showFailed(this,null,message);
}
},evalResponse:Prototype.emptyFunction,setRequestHeaders:function(){
var _3b=[];
if(this.options.mode=="JSON"){
_3b.push("Accept","text/javascript");
}
if(this.options.method=="post"){
_3b.push("Content-type","application/xml");
if(this.transport.overrideMimeType){
_3b.push("Connection","close");
}
}
_3b.push.apply(_3b,this.options.requestHeaders||[]);
for(var i=0;i<_3b.length;i+=2){
this.transport.setRequestHeader(_3b[i],_3b[i+1]);
}
}});
function varToXML(obj){
return namedVarToXML(null,obj,"\n").substr(1);
}
function namedVarToXML(_3e,obj,_40){
if(obj==null){
return _40+tagXML("null",_3e);
}
var _41=obj.constructor;
if(_41==String){
return _40+tagXML("string",_3e,textXML(obj));
}else{
if(_41==Object){
if(obj.nodeType){
alert("Passing invalid object: "+Object.inspect(obj));
return "";
}
var s="";
for(var i in obj){
s+=namedVarToXML(i,obj[i],_40+"  ");
}
return _40+tagXML("object",_3e,s+_40);
}else{
if(_41==Array){
var s="";
for(var i=0;i<obj.length;i++){
s+=namedVarToXML(null,obj[i],_40+"  ");
}
return _40+tagXML("array",_3e,s+_40);
}else{
if(_41==Boolean||_41==Number){
var s=obj.toString();
return _40+tagXML(getVarType(obj,s),_3e,s);
}else{
if(_41==Date){
var s=""+obj.getFullYear()+"-"+(obj.getMonth()+1)+"-"+obj.getDate();
if(obj.getHours()>0||obj.getMinutes()>0||obj.getSeconds()>0){
s+=" "+obj.getHours()+":"+obj.getMinutes()+":"+obj.getSeconds();
}
return _40+tagXML(getVarType(obj,s),_3e,s);
}else{
alert("Passing invalid object: "+Object.inspect(obj));
return "";
}
}
}
}
}
}
function getVarType(obj,_45){
if(obj==null){
return "null";
}
var _46=obj.constructor;
if(_46==String){
return "string";
}else{
if(_46==Object){
return "object";
}else{
if(_46==Array){
return "array";
}else{
if(_46==Date){
return "date";
}else{
if(_46==Boolean){
return "boolean";
}else{
if(_46==Number){
var s=_45?_45:obj.toString();
if(s.indexOf(".")==-1){
if(obj>=-2*1024*1024*1024&obj<2*1024*1024*1024){
return "int";
}else{
if(!isNaN(obj)){
return "long";
}
}
}
return "number";
}
}
}
}
}
}
}
function tagXML(_48,_49,_4a){
var s="<"+_48;
if(_49){
s+=" name=\""+textXML(_49,true)+"\"";
}
if(_4a){
s+=">"+_4a;
if(_4a.charAt(_4a.length-1)==">"){
s+="\n";
}
return s+"</"+_48+">";
}else{
return s+" />";
}
}
function textXML(s,_4d){
s=s.htmlencode();
s=s.replace(/[\x00-\x08\x0b\x0e-\x1f]/g,"");
return s;
}
CMXClient.prototype.simpleGetText=function(_4e,_4f){
submit(this,_4e,null,{method:"get",on200:(function(_50){
this.handled=true;
_4f(_50.responseText);
}).bind(this)});
};
CMXClient.prototype.simpleCall=function(_51,_52,_53,_54){
submit(this,_51,_52,{mode:"JSON",postBody:varToXML(_52),aj_S_OK:(function(_55){
if(_53){
_53(_55["var"],_54);
}
}).bind(this)});
};
CMXClient.prototype.simpleSequential=function(_56,_57){
var o={items:[]};
for(var i=0;i<_56.length;i+=2){
o.items[i/2]={func:_56[i],"var":_56[i+1]};
}
function _handler(_5a){
var _5b=[];
for(var i=0;i<_5a.length;i++){
_5b[i]=_5a[i]["var"];
}
if(_57){
_57(_5b);
}
}
this.simpleCall("sequential",o,_handler);
};
})();

CM.User={email:"UNKNOWN",primary_email:"UNKNOWN",dn_email:"UNKNOWN","@ou":"UNKNOWN",aliases:[],attrs:{maxlist:20,mms_enabled:1,replyf:0,addo:0,afterdel:1,save_sent:1,true_name:"",op_readreceipt:0,delegatedsender:"",first_week_day:1,start_hour:8*60*60,end_hour:17*60*60,signature_position:0,firstpage:0,edit_mode:0,aftersend_saveaddr:0,time_zone:"+8",displaysender:0},cos:{pref_quota:5,pref_smtp_max_mail_count:5,pref_webmail_max_signatures:5,pref_auto_forward_email_count:5,pref_pop_agent_accounts:1,pref_upload_size:1,perm_func_schedule_send:1,perm_webmail_pop_agent:1,perm_webmail_mail_search:1,pref_smtp_max_num_rcpts:1000000,perm_mail_autoreply:1,perm_mail_autoforward:1,perm_mail_filter:1,perm_mail_sms_notify:1,perm_webmail_html_editor:1,perm_webmail_mail_get_rfc:1,pref_netfolder_quota:0,pref_netfolder_max_file_size:0,pref_netfolder_max_file_count:0,pref_max_folder_nest_level:5,pref_alias_seeds:0,perm_webmail_sendmail:1}};
CM.User.getDomain=function(){
var u=CM.User.primary_email;
var _2=u.indexOf("@");
return (_2>-1)?u.substr(_2+1):"";
};
CM.User.getDefaultDomain=function(){
var u=CM.User.email;
var _4=u.indexOf("@");
return (_4>-1)?u.substr(_4+1):"";
};
CM.User.getAllEmails=function(_5){
return CM.User.getLocalEmails(_5).concat(CM.User.getDelegatedEmails());
};
CM.User.getLocalEmails=function(_6){
var _7=CM.User.attrs.true_name;
var _8=CM.User.primary_email;
var _9=_6&&_7;
var _a=[_9?_7+"<"+_8+">":_8].concat(CM.User.getAllAliasEmails(_6));
var _b=[_8].concat(CM.User.getAllAliasEmails(false));
var _c=CM.User.email;
if(!_b.include(_c)){
_a.push(_9?_7+"<"+_c+">":_c);
}
return _a;
};
CM.User.getDelegatedEmails=function(){
var _d=CM.User.attrs.delegatedsender||"";
return EmailAddress.parse(_d).select(function(_e){
return !!_e.getAddress();
}).map(function(_f){
return _f.toString();
});
};
CM.User.getAllAliasEmails=function(_10){
return CM.User.aliases.collect(function(_11){
var _12=_10&&(_11.name||CM.User.attrs.true_name);
return _12?_12+"<"+_11.id+">":_11.id;
});
};
function User_Init(_13,_14,_15){
for(var key in _13){
if(typeof CM.User[key]!="undefined"){
CM.User[key]=_13[key];
}else{
CM.User.cos[key]=_13[key];
}
}
CM.User.attrs=_14;
CM.User.aliases=[];
_15.each(function(_17){
_17.aliases.each(function(_18){
CM.User.aliases.push(_18);
});
});
}
CM.User.xattrs={};
CM.User.passwordSchema={"cur_password":{valid:function(a){
return a==""?gLang.password["msg"]["curpassempty"]:"";
}},"new_password1":{valid:function(a){
return a==""?gLang.password["msg"]["newpassempty"]:"";
}},"new_password2":{valid:function(a){
if(a==""){
return gLang.password["msg"]["newpass2empty"];
}else{
if(a!=$("new_password1").value){
return gLang.password["msg"]["passnotsame"];
}
}
return "";
}}};
CM.User.birthdaySchema={display:function(a,o){
o.value=((a!=null&&a.constructor==Date)?a.formatDate():"YYYY-MM-DD");
},store:function(o){
return (o.value==""||o.value=="YYYY-MM-DD")?null:Date.parseDate(o.value);
},valid:function(a){
return (a==""||a=="YYYY-MM-DD"||fCheckDate(a))?"":gLang.personal.msg.dateerr;
}};
CM.User.questionSchema={"oldBirthday":CM.User.birthdaySchema,"oldAnswer":{},"newBirthday":CM.User.birthdaySchema,"newQuestion":{valid:function(a){
return a==""?gLang.question.msg.newquestionempty:"";
}},"newAnswer":{valid:function(a){
return a==""?gLang.question.msg.newanswerempty:((a.length<6||a.length>20)?gLang.question.msg.newanswershort:"");
}}};
CM.User.personalSchema={"alt_mail":{},"true_name":{"update":function(a){
CM.User.attrs.true_name=a;
}},"nick_name":{},"gender":{"display":function(a,o){
if(a!=null&&a!=""){
$(o.name+a).checked=true;
}
}},"birthday":CM.User.birthdaySchema,"mobile_number":{},"home_phone":{},"company_phone":{},"fax_number":{},"address":{},"zipcode":{},"province":{"display":function(a,o){
fUpdateProvince($(o.name),a);
},"store":function(o){
return o.value==""?"":(""+o.value);
}},"city":{"display":function(a,o){
fUpdateCity($("province").value,$(o.name),a);
},"store":function(o){
return o.value==""?"":(""+o.value);
}},"homepage":{"display":function(a,o){
o.value=(a==""?"http://":a);
},"store":function(o){
return (o.value==""||o.value=="http://")?"":o.value;
}},"anniversary":CM.User.birthdaySchema};
CM.User.personalWithValueSchema={"id":"Personal","withValue":true};
CM.User.preferenceSchema={"time_zone":{"display":function(a,o){
if(a==null){
a=8;
}else{
if(a<0){
a=12-a;
}
}
fUpdateSelection($(o.name),a,gLang.preference_time_zone);
},"store":function(o){
var a=o.value;
if(a>12){
a=12-a;
}
return ""+a;
}},"maxlist":{"default":0},"addo":{"default":0},"replyf":{"default":0},"afterdel":{"default":0},"displaysender":{"default":0},"op_readreceipt":{"default":0},"save_sent":{"default":0},"edit_mode":{"default":0},"signature_position":{"default":0},"firstpage":{"default":0},"aftersend_saveaddr":{"default":0}};
CM.User.forwardSchema={"forwardactive":{"default":0},"forwarddes":{"valid":function(a){
if($("forwardactive1").checked||$("forwardactive0").checked){
var e=a.split(/[;,]/);
if(a.length>248||e.length>CM.User.cos.pref_auto_forward_email_count){
return gLang.forward.msg["toolong"];
}
for(var i=0;i<e.length;++i){
if(!isEmailAddr(e[i])){
return gLang.forward.msg["targeterr"];
}else{
if(e[i]==GE.UID){
return gLang.forward.msg["forwardtoself"];
}
}
}
}
return "";
}},"keeplocal":{"display":function(a,o){
o.checked=(a==1);
},"store":function(o){
return o.checked?1:0;
}}};
CM.User.autorespSchema={"autorepmode":{"default":0},"autoreptext":{"display":function(a,o){
if(a==null||a.trim==""){
a=gLang.autoresp["deafulcontent"];
}
o.value=a;
},"valid":function(a){
return (a.len()>2000)?gLang.autoresp.msg["toolong"]:"";
}}};
CM.User.ruleSchema={"id":{},"name":{"valid":function(a){
return (a=="")?gLang.mailfilter.msg["nameempty"]:"";
}},"disabled":{"default":0},"continue":{"default":1},"from_chk":{},"from_cond":{"display":function(a,o){
fUpdateSelection($(o.name),a,gLang.rule_text_cond,null,true);
}},"from_text":{},"from_case":{},"from_foradd":{"display":function(a,o){
o.checked=a;
},"store":function(o){
return o.checked;
}},"rcpt_chk":{},"rcpt_cond":{"display":function(a,o){
fUpdateSelection($(o.name),a,gLang.rule_text_cond,null,true);
}},"rcpt_text":{},"rcpt_case":{},"subj_chk":{},"subj_cond":{"display":function(a,o){
fUpdateSelection($(o.name),a,gLang.rule_text_cond,null,true);
}},"subj_text":{},"subj_case":{},"size_chk":{},"size_cond":{"display":function(a,o){
fUpdateSelection($(o.name),a,["<",">"],null,true);
}},"size_text":{"valid":function(a){
return (a!=""&&parseInt(a)>2147483647)?gLang.mailfilter.msg["overrunMaxsize"]:"";
}},"account_chk":{},"account_text":{"display":function(a,o){
var _4a=$(o.name);
var idx=0;
var _4c={};
_4a.options[idx++]=new ($win().Option)(gLang.mailfilter.inputpage["main_account"]+" "+CM.User.primary_email,CM.User.dn_email);
for(var i=0;i<a.length;++i){
var _4e=a[i];
if(_4e==CM.User.dn_email){
_4a.options[0].selected=true;
}else{
_4c[_4e]=true;
_4a.options[idx]=new ($win().Option)(gLang.mailfilter.inputpage["unknown_account"]+" "+_4e,_4e);
_4a.options[idx++].selected=true;
}
}
if(CM.User.cos.perm_webmail_pop_agent||CM.User.cos.pref_alias_seeds){
var _4f=null,aliases=null;
if(CM.User.cos.perm_webmail_pop_agent){
_4f=CM.pop3;
}
if(CM.User.cos.pref_alias_seeds){
aliases=CM.User.getAllAliasEmails(false);
}
var i=1;
_4a.length=i;
if(_4f!=null){
for(var j=0;j<_4f.length;++j){
var _51=CMXMail.getPop3EMailAccount(_4f[j]);
_4a.options[i]=new ($win().Option)(gLang.mailfilter.inputpage["pop3_account"]+" "+_51,_51);
if(_4c[_51]){
_4a.options[i].selected=true;
_4c[_51]=false;
}
++i;
}
}
if(aliases!=null){
for(var j=0;j<aliases.length;++j){
var _51=aliases[j];
_4a.options[i]=new ($win().Option)(gLang.mailfilter.inputpage["alias_account"]+" "+_51,_51);
if(_4c[_51]){
_4a.options[i].selected=true;
_4c[_51]=false;
}
++i;
}
}
for(var k in _4c){
if(_4c[k]&&k!=CM.User.dn_email&&k!=""){
_4a.options[i]=new ($win().Option)(gLang.mailfilter.inputpage["unknown_account"]+" "+k,k);
_4a.options[i++].selected=true;
}
}
}
},"store":function(o){
var res=[];
var _55=$(o.name);
for(var i=0;i<_55.options.length;++i){
if(_55.options[i].selected){
res[res.length]=_55.options[i].value;
}
}
return res;
},"valid":function(a){
return (a==""&&$("account_chk").checked)?gLang.mailfilter.msg["accountempty"]:"";
}},"reject_chk":{},"move_chk":{},"move_fid":{"display":function(a,o){
var _5a=[];
var _5b=[];
var _5c=0;
CM.MBOX.forEachFolder(function(fi){
if(fi.id==a){
_5c=_5a.length;
}
_5a[_5a.length]=fi.getPath();
_5b[_5b.length]=fi.id;
});
fUpdateSelection($(o.name),_5c,_5a,null,true);
$(o.name).fid=_5b;
},"store":function(o){
return $(o.name).fid[o.selectedIndex];
}},"forward_chk":{},"forward_text":{"valid":function(a){
if(a==""&&($("forward_chk").checked)){
return gLang.mailfilter.msg["forwardtargeterr"];
}
var _60=a.split(",");
if(_60.length>CM.User.cos.pref_auto_forward_email_count){
return gLang.mailfilter.msg["over_limit"];
}
for(var i=0;i<_60.length;i++){
if(_60[i]!=""&&!isEmailAddr(_60[i])){
return gLang.mailfilter.msg["forwardtargeterr"];
}else{
if(_60[i]==GE.UID){
return gLang.mailfilter.msg["forwardself"];
}
}
}
return "";
}},"forward_keep":{},"reply_chk":{},"reply_text":{},"sms_chk":{},"sms_text":{"valid":function(a){
return (a==""||(/^13[\d]{9}$/.test(a)))?"":gLang.mailfilter.msg["mobileerr"];
}}};
CM.User.junkfilterSchema={"junkfilter":{"default":1},"rejectjunk":{"default":1}};
CM.User.antivirusOptSchema={"enable":{},"succeed":{},"failed":{},"undetermined":{},"notifyUser":{},"notifySender":{}};
CM.User.smsnotifySchema={"notify":{}};
CM.User.phonebindingSchema={"cellNumber":{},"verifyCode":{}};
CM.User.addressSchema={"id":{},"FN":{"valid":function(a){
if(a==""){
AddrEditDialogImp.changeExpand("iaddDetail");
return gLang.address.msg["msg_noname"];
}
return "";
}},"EMAIL;PREF":{"valid":function(a){
if(EmailAddress.parseSingleEmail(a)==""||!isEmailAddr(a)){
AddrEditDialogImp.changeExpand("iaddDetail");
return gLang.address.msg["msg_noemail"];
}
return "";
}},"BDAY":{"display":function(a,o){
if(a!=null&&a.constructor==Date){
$("year").value=a.getFullYear();
$("mon").value=a.getMonth()+1;
$("day").value=a.getDate();
}
},"valid":function(a){
var y,m,d;
y=$("year").value.trim();
m=$("mon").value.trim();
d=$("day").value.trim();
if(y!=""&&m!=""&&d!=""){
if(!y.isNumber()||!m.isNumber()||!d.isNumber()){
AddrEditDialogImp.changeExpand("iaddDetail");
$("year").focus();
return gLang.address.msg["msg_birthdayerr"];
}
var _69=y+"-"+m+"-"+d;
var _6a=Date.parseDate(_69);
if(_6a.getFullYear()!=y||_6a.getMonth()+1!=m||_6a.getDate()!=d){
return gLang.address.msg["msg_birthdayerr"];
}
if((new Date(y-0,m-1,d-0))>(new Date())){
AddrEditDialogImp.changeExpand("iaddDetail");
$("year").focus();
return gLang.address.msg["msg_birthdaytoolate"];
}
return "";
}else{
if(!y&&!m&&!d){
return "";
}else{
return gLang.address.msg["msg_birthdaycomplete"];
}
}
},"store":function(o){
var y,m,d;
if((y=$("year").value.trim())!=""&&(m=$("mon").value.trim())!=""&&(d=$("day").value.trim())!=""){
return new Date(y-0,m-1,d-0);
}else{
return "";
}
}},"ICQ":{},"URL":{},"ADR;HOME":{},"PC;HOME":{"valid":function(a){
if(a!=""&&(!a.isNumber()||a.match(/^\d{6}$/)==null)){
AddrEditDialogImp.changeExpand("iaddWork");
return gLang.address.msg["msg_ziperr"];
}
return "";
}},"TEL;HOME;VOICE":{},"TEL;CELL":{},"ORGNAME":{},"ADR;WORK":{},"PC;WORK":{"valid":function(a){
if(a!=""&&(!a.isNumber()||a.match(/^\d{6}$/)==null)){
AddrEditDialogImp.changeExpand("iaddWork");
return gLang.address.msg["msg_zip_work_err"];
}
return "";
}},"TEL;WORK;VOICE":{},"TEL;WORK;FAX":{},"ZS":{}};
CM.User.searchAddSchema=["FN","EMAIL;PREF","BDAY","ICQ","URL","ADR;HOME","PC;HOME","TEL;HOME;VOICE","TEL;CELL","ORGNAME","ADR;WORK","PC;WORK","TEL;WORK;VOICE","TEL;WORK;FAX","ZS"];
CM.User.validateSchema={"email":function(a){
return (a&&isEmailAddr(a))?"":gLang.personal.msg["emailerr"];
},"phone":function(a){
return (a&&(/^\d+?(\-)?\d+$/.test(a)))?"":gLang.personal.msg["phoneerr"];
},"zipcode":function(a){
return (a&&(/^\d+$/.test(a))?"":gLang.personal.msg["zipcodeerr"]);
},"date":function(a){
return (a==""||a=="YYYY-MM-DD"||fCheckDate(a))?"":gLang.personal.msg["dateerr"];
}};

function CMFolderBase(){
}
function CM$AbstractList(){
}
(function(){
function _dsize(a){
return (a>0)?a:0;
}
var _2=Number.getRatio;
var _3=Number.getPercent;
CMFolderBase.prototype={getFreeCount:function(){
return _dsize(this.getMaxCount()-this.getTotalCount());
},getFreeCountRatio:function(){
return _2(this.getFreeCount(),this.getMaxCount());
},getUsedCountPercent:function(){
return _3(this.getTotalCount(),this.getMaxCount());
},getFreeSize:function(){
return _dsize(this.getQuotaSize()-this.getUsedSize());
},getUsedRatio:function(){
return _2(this.getUsedSize(),this.getQuotaSize());
},getFreeRatio:function(){
return _2(this.getFreeSize(),this.getQuotaSize());
},getUsedPercent:function(){
return _3(this.getUsedSize(),this.getQuotaSize());
},getFreePercent:function(){
return _3(this.getFreeSize(),this.getQuotaSize());
},getFolderItem:function(_4){
return CMFolderBase.findById(this.allFolders(),_4);
},getRoot:Prototype.emptyFunction,getRootChildren:function(){
return this.getRoot().children;
},allFolders:function(_5){
if(arguments.length==0){
_5=this.getRoot()||this.getRootChildren();
}else{
if(typeof _5=="number"){
_5=this.getFolderItem(_5);
}
}
return new Traverse(_5);
},forEachFolder:function(_6){
return this.allFolders().detect(_6);
},getSelectOptions:function(_7){
var _8="";
this.allFolders().each(function(fi){
var _a=(fi.id==_7)?" selected":"";
_8+="<option value=\""+fi.id+"\""+_a+">"+fi.getPath().escapeHTML()+"</option>";
});
return _8;
}};
function Traverse(_b){
this._each=function(_c){
function doIterate(_d){
if(_d==null){
}else{
if(_d.constructor==Array){
_d._each(doIterate);
}else{
_c(_d);
doIterate(_d.children);
}
}
}
doIterate(_b);
};
}
Object.extend(Traverse.prototype,Enumerable);
CMFolderBase.findById=function(_e,id){
return _e.detect(function(_10){
return _10.id==id;
});
};
CMFolderBase.sumStats=function(_11,_12){
return _11.inject(0,function(sum,fi){
return sum+=(fi.stats)?fi.stats[_12]:0;
});
};
CMFolderBase.folderPrototype={all:function(){
return new Traverse(this);
},sumStats:function(_15){
return CMFolderBase.sumStats(this.all(),_15);
}};
})();
Object.extend(CM$AbstractList.prototype,{getPageCount:function(){
var _16=this.getWindowSize();
if(_16<=0){
return 1;
}
var _17=this.getTotal();
if(_17<=0){
return 1;
}
return Math.floor((_17+_16-1)/_16);
},getCurPage:function(){
var _18=this.getWindowSize();
if(_18<=0){
return 0;
}
var pos=MM[this.getModuleName()].nPageStart;
if(!pos){
return 0;
}
return Math.floor(pos/_18);
},hasPrePage:function(){
return (this.getCurPage()!=0);
},hasNextPage:function(){
return (this.getCurPage()<this.getPageCount()-1);
},getWindowSize:function(){
return CM.User.attrs.maxlist||20;
},relativePage:function(_1a,_1b){
this.goPageN(this.getCurPage()+_1a,_1b);
},absolute:function(pos){
if(pos<0){
pos+=this.getTotal();
}
var _1d=this.getWindowSize();
var _1e=Math.floor(pos/_1d);
var _1f=pos-_1e*_1d;
this.goPageN(_1e,_1f);
},goPageN:function(_20,_21){
var _22=this.getCurPage();
if(_22!=_20){
MM[this.getModuleName()].nPageStart=_20*this.getWindowSize();
this.loadPage(_21);
}else{
this.focus(_21);
}
},focus:function(_23){
if(_23<0){
_23+=this.getWindowSize();
}
var dg=MM[this.getModuleName()].dg;
if(dg){
dg.HTML.setLastSelectFocus(_23);
}
}});

CM.MBOX=new CMFolderBase;
(function(){
var _1;
var _2;
var _3;
var _4;
var _5=Object.extend(Object.extend({},CMFolderBase.folderPrototype),{getPath:function(){
return this._parent?this._parent.getPath()+"/"+this.name:this.name;
},getPathHTML:function(){
return this._parent?this._parent.getPathHTML()+"/"+this.name.htmlencode():this.name.htmlencode();
},getPercent:function(){
return Number.getPercent(this.stats.messageSize,CM.MBOX.getQuotaSize());
},canRename:isUserFolder,canDelete:isUserFolder,canEmpty:function(){
return (!this.flags.system||this.id==4||this.id==5||this.id==6);
},wasEmpty:function(_6){
return !(_6&&this.hasChildren())&&(this.stats.messageCount==0);
},hasChildren:function(){
return this.children&&this.children.length>0;
},getFolderNestLevel:function(){
var _7=1;
var _8=this._parent;
while(_8!=null){
_7++;
_8=_8._parent;
}
return _7+1;
}});
function isUserFolder(){
return !this.flags.system;
}
function doLoadFolders(_9){
var _a=CM.MBOX.getQuotaSize();
var _b=0,totalSize=0,unreadMessageCount=0;
_1=_9;
CM.MBOX.allFolders().each(function(fi){
if(fi.children){
for(var i=0;i<fi.children.length;i++){
fi.children[i]._parent=fi;
}
}
Object.extend(fi,_5);
_b+=fi.stats.messageCount;
totalSize+=fi.stats.messageSize;
unreadMessageCount+=fi.stats.unreadMessageCount;
});
_2=_b;
_3=totalSize;
_4=unreadMessageCount;
}
CM.MBOX.getLastSystemFid=function(){
var _e=4;
for(var i=0;i<_1.length;i++){
var fi=_1[i];
if(fi.id<20&&fi.id>_e){
_e=fi.id;
}
}
return _e;
};
Object.extend(CM.MBOX,{getTotalCount:function(){
return _2;
},getNewCount:function(){
return _4;
},getMaxCount:function(){
return CM.User.cos.pref_smtp_max_mail_count;
},getQuotaSize:function(){
return CM.User.cos.pref_quota*1048576;
},getUsedSize:function(){
return _3;
},getRootChildren:function(){
return _1;
}});
CM.MBOX.forEachFolder=function(_11){
return CM.MBOX.allFolders().detect(_11);
};
var _12;
window.MBOX_Init=function(_13){
doLoadFolders(_13);
_12=setTimeout(CC.getNewMailCount,gGetNewMailInterval);
};
function getExcludeUnreadMessageCount(){
var _14=0;
for(var i=0;i<_1.length;i++){
var _16=_1[i];
if(_16.flags.system&&(_16.id!=1)){
_14+=_16.stats.unreadMessageCount;
}
}
return _14;
}
function doRefreshFolders(_17){
var _18=_4;
var _19=_2;
var _1a=_3;
var _1b=getExcludeUnreadMessageCount();
MBOX_Init(_17);
var _1c=getExcludeUnreadMessageCount();
if((_18!=_4)||(_1b!=_1c)||(_19!=_2)||(_1a!=_3)){
for(var _1d in gInboxFlag){
if(_1d!="unRead"){
fUpdateModule(_1d);
}
}
}
var _1e=_4-_18-Math.max(getExcludeUnreadMessageCount()-_1b,0);
MBOX_folderChanged(_1e);
}
window.MBOX_reload=function(){
clearTimeout(_12);
new CMXClient().simpleCall("mbox:getAllFolders",{stats:true},doRefreshFolders);
};
window.MBOX_submit=function(_1f,_20,_21){
clearTimeout(_12);
UI.showWaiting(gLang.GLOBAL.tips_handling);
var _22=[_1f,_20,"mbox:getAllFolders",{stats:true}];
new CMXClient().simpleSequential(_22,function(_23){
doRefreshFolders(_23[1]);
(_21||Prototype.emptyFunction)(_23[0]);
});
};
window.MBOX_updateUnread=function updateUnread(fid,_25){
var fi=CM.MBOX.getFolderItem(fid);
if(fi){
fi.stats.unreadMessageCount+=_25;
_4+=_25;
MBOX_folderChanged();
}
};
})();
function MBOX_folderChanged(_27){
gApps.mbox.treeView.render();
MM.createModule("welcome");
fResetFolderTabs();
if(_27>0){
UI.playMessage(String.format(gLang.GLOBAL.tips_newmsg,_27));
}
}
function MBOX_createFolder(fid){
var lnk="lnk"+((fid&&fGetModuleByFid(fid))||"welcome");
var _2a=fGetDefinedFolderName(1,fid,CM.MBOX);
UI.TreeView.createChild(lnk,function(_2b){
var val=checkInputFolderName(_2b);
if(val){
MBOX_submit("mbox:createUserFolders",{items:[{name:val,parent:fid}]});
}
},_2a);
}
function MBOX_deleteFolder(fid){
var fi=CM.MBOX.getFolderItem(fid);
if(CM["pop3"]){
var _2f=CM["pop3"];
for(var i=0,len=_2f.length;i<len;i++){
var ap=_2f[i];
if(fid==ap.fid){
UI.alert(String.format(gLang.folder.msg.delPopFolder,ap.username));
return;
}
}
}
if(fi&&window.confirm(String.format(gLang.folder.msg.confirm_del,fi.name))){
var _32=fGetModuleByFid(fid);
MBOX_submit("mbox:deleteFolders",{ids:[fid]});
UI.Tab.close(_32);
}
}
function MBOX_setAllSeen(fid){
new CMXClient().simpleCall("mbox:searchMessages",{fid:fid,recursive:false},function(_34){
var req={ids:_34,attrs:{}};
if(!req.attrs.flags){
req.attrs.flags={};
}
req.attrs.flags.read=true;
MBOX_submit("mbox:updateMessageInfos",req);
});
}
function MBOX_emptyFolder(fid){
var fi=CM.MBOX.getFolderItem(fid);
if(fi&&window.confirm(String.format(gLang.folder.msg.confirm_empty,fi.name))){
var _38=fGetModuleByFid(fid);
MBOX_submit("mbox:emptyFolder",{id:fid},function(){
fUpdateModule(_38);
if(_38!="deleted"){
fUpdateModule("deleted");
}
});
}
}
function MBOX_renameFolder(fid){
var fi=CM.MBOX.getFolderItem(fid);
inlineRename("lnk"+fGetModuleByFid(fid),fi.name,function(_3b,_3c){
MBOX_submit("mbox:updateFolders",{items:[{id:fid,name:_3c}]});
});
}
gApps.mbox.treeView=new UI.TreeView(gApps.mbox.tree,{getRoot:function(){
var _3d=[{icon:"mboxIco",name:gLang.folder.page.rootName,link:{id:"lnkwelcome",moduleName:"welcome"},moreAction:{text:gLang.folder.page.addFolder,functionName:"MBOX_createFolder"},children:CM.MBOX.getRootChildren()}];
if(MM["unRead"].load){
_3d.push({icon:"treeSearch",name:gLang.search.resultTitle,link:{id:"lnkunRead",moduleName:"unRead"}});
}
return _3d;
},getNode:function(fi){
var _3f=CC.getModuleByFid(fi.id);
var _40={id:fi.id,icon:MM[_3f].icon,name:fi.name,link:{id:"lnk"+_3f,moduleName:_3f},children:fi.children};
if(fi.flags.system&&fi.canEmpty()){
_40.moreAction={text:gLang.folder.action.empty,functionName:"MBOX_emptyFolder",args:[fi.id],disabled:fi.wasEmpty()};
}
var _41=fi.stats.unreadMessageCount;
if(_41>0){
_40.link.html="<span class='fbold'>"+fi.name.escapeHTML()+" <span class='blueName'>("+_41+")</span></span>";
}
return _40;
},resolveIdFromLink:function(_42){
var _43=_42.replace("lnk","");
return fGetFidByModuleName(_43);
}});
gApps.mbox.buildContextMenu=function(o,_45){
var _46=(_45||"").replace("lnk","");
o[0].width="120";
var fid=CC.getFidByModule(_46);
var fi=CM.MBOX.getFolderItem(fid);
if(_46=="unRead"){
o.push([gLang.search.clearresult,function(){
UI.Tab.close(_46);
delete CM[_46];
MM[_46].load=false;
gApps.mbox.treeView.render();
}]);
}else{
if(MM[_46]&&MM[_46].isFolder){
o.push([gLang.folder.menu.addfolder,MBOX_createFolder.bind(null,fid)],[gLang.folder.menu.rename,fi.canRename()&&MBOX_renameFolder.bind(null,fid)],[gLang.folder.menu.delfolder,fi.canDelete()&&fi.wasEmpty(true)&&MBOX_deleteFolder.bind(null,fid)],[gLang.folder.menu.emptyfolder,fi.canEmpty()&&!fi.wasEmpty()&&MBOX_emptyFolder.bind(null,fid)],[gLang.folder.menu.setseen,MBOX_setAllSeen.bind(null,fid)]);
if((fi.getFolderNestLevel())>=CM.User.cos.pref_max_folder_nest_level){
o[1][1]=false;
}
}else{
o.push([gLang.folder.menu.addfolder,MBOX_createFolder]);
}
}
o.push("empty",[gLang.folder.menu.emptytrash,getEmptyAction(4)],[gLang.folder.menu.emptyvirus,getEmptyAction(5)],"empty",[gLang.menu.refresh,MBOX_reload]);
function getEmptyAction(id){
var fi=CM.MBOX.getFolderItem(id);
return fi&&!fi.wasEmpty()&&MBOX_emptyFolder.bind(null,id);
}
};

function fGetDefinedFolderName(n,_2,_3){
var _4=gLang.folder.page["unnamedFolder"];
var _5=_4+n;
var _6;
if(_2){
_6=(_3.getFolderItem(_2)||{}).children;
}else{
_6=_3.getRootChildren();
}
if(_6){
for(var i=0;i<_6.length;i++){
var fi=_6[i];
if(fi.name==_5){
_5=_4+(++n);
i=0;
}
}
}
return _5;
}
function inlineRename(_9,_a,_b){
UI.TreeView.renameNode(_9,function(_c,id){
if(_c.value==_a){
return false;
}
var _e=checkInputFolderName(_c);
if(_e){
_b(id,_e);
}
},_a);
}
function checkInputFolderName(_f){
return checkInputName(_f,gLang.GLOBAL.obj_folder,24,":*?<>|=,^");
}
function checkInputName(_10,_11,_12,_13){
var _14,cb;
if(typeof _10=="string"){
_14=_10.trim();
cb=null;
}else{
_14=_10.value.trim();
cb=Field.activate.bind(null,_10);
}
if(_14==""){
var msg=String.format(gLang.GLOBAL.msg_name_empty,_11);
UI.alert(msg,cb);
return false;
}
if(_14.len()>_12){
var msg=String.format(gLang.GLOBAL.msg_name_too_long,_11,_12,Math.floor(_12/2));
UI.alert(msg,cb);
return false;
}
var _16="%'\"\\/";
if(_13){
_16+=_13;
}
for(var i=0;i<_14.length;i++){
if(_16.indexOf(_14.charAt(i))>=0){
var msg=String.format(gLang.GLOBAL.msg_invalid_char,_16.split("").join(" "));
UI.alert(msg,cb);
return false;
}
}
return _14;
}
MM["folder"].del=fFolder_Delete;
MM["folder"].refuse=fFolder_refuse;
MM["folder"].report=fFolder_report;
MM["folder"].mark=fFolder_mark;
MM["folder"].move=fFolder_move;
MM["folder"].operate=fFolderHandle;
MM["folder"].folderHandle=fFolderHandle;
MM["folder"].folderDop=fMoveLettersByDrop;
MM["folder"].getHtml=fFolder_getHtml;
MM["folder"].getToolbar=fFolder_getToolbar;
MM["folder"].getToolbarMenu=fFolder_getToolbarMenu;
MM["folder"].init=fFolder_init;
MM["folder"].setContentHeight=fFolder_setContentHeight;
MM["folder"].resize=fFolder_resize;
MM["folder"].getDataGrid=fFolder_getDataGrid;
MM["folder"].synData=fFolder_synData;
MM["folder"].readByContextMenuByNewWin=fFolder_readByContextMenuByNewWin;
MM["folder"].readByContextMenuByNewTab=fFolder_readByContextMenuByNewTab;
MM["folder"].printPage=fFolder_printPage;
MM["folder"].removeLetters=fFolder_removeLetters;
MM["folder"].getNewSubmitFrame=fFolder_getNewSubmitFrame;
MM["folder"].changeMailStatus=fFolder_changeMailStatus;
MM["folder"].changeMailStatusByMid=fFolder_changeMailStatusByMid;
MM["folder"].goSearch=fFolder_goSearch;
MM["folder"].getName=function(){
if(this.isRealFolder()){
return CM.MBOX.getFolderItem(fGetFidByModuleName(this.moduleName)).name;
}else{
return gLang.search.resultTitle;
}
};
MM["folder"].getNamePad=function(){
var _18=CM[this.moduleName].getTotal();
return (_18)?String.format(gLang.GLOBAL["tab_letterUnit"],_18):gLang.GLOBAL["tab_noLetter"];
};
function fFolder_getHtml(){
var _19=this.moduleName;
var _1a=""+"<div style=\"border-width:1px; border-style:solid\" id=\"MailListDiv"+_19+"\" class=\"border1\"  onselectstart=\"return false;\"></div>";
if(GE.readType=="0"){
_1a+="<div class=\"gRsbr3 mouseRsRow\" id=\"dvVSplitter"+_19+"\">"+"<b class=\"gRbBlk btnS alignCen\"></b></div>"+"<div class=\"border1\" style=\"height:238px; height:239px; overflow:auto\" id=\"dvLetterContent"+_19+"\">"+this.getPanelHtml()+"</div>";
}
return _1a;
}
MM["folder"].getPanelHtml=function(){
var _1b=this.moduleName;
return ""+"<div class=\"bgF2 readMailHeaderBG\" ></div>"+"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  class=\"readMailHeaderTable bgcolor2 fbk3\" id=\"readMailHeaderTab"+_1b+"\" name=\"readMailHeaderTab\" height=\"50\" >"+"<tr><td class=\"readMailHeaderCont fgn fbold\">"+"<div id=\"moreCont\" style=\"display:none;\" class=\"bgcolor5 readMailHeaderCont\"></div>"+"</td></tr>"+"<tr>"+"<td colspan=\"2\" class=\"readMailHeaderCont fbk3 border1\" >"+"<table width=\"100%\">"+"<tr>"+"<td width=\"50\" height=\"25\" valign=\"top\" class=\"readMailHeaderPad1 fbk3\" ></td>"+"</tr>"+"</table></td>"+"</tr>"+"</table>"+"<div style=\"height:160px; background-color:#ffffff\" id=\"dvLetterContentText"+_1b+"\">"+"<div id=\"ifrReadPart"+_1b+"\">"+"<div style=\"padding:15px; line-height:200%; color:#333\"><br>"+"<h3><b class=\"btnS top_ico\"></b>&nbsp;"+gLang.help["tips"]+":</h3>"+"<p style=\"padding:5px 0 0 24px \">"+gLang.help["tips_content"]+"</p>"+"</div></div></div>";
};
MM["folder"].refresh=function(){
this.nPageStart=null;
CM[this.moduleName].loadPage();
};
function fFolder_getToolbar(_1c){
var _1d=MM[_1c].dg.HTML.getSelectTargetArray();
var _1e=(_1d.length==0);
var _1f=(_1d.length==1);
var _20=[];
if(CM.User.cos.perm_webmail_sendmail){
_20.add(UI.Toolbar.getMenuButton("reply",gLang.read.toolbar.reply,"btnRe",!_1f));
_20.add(UI.Toolbar.getMenuButton("forward",gLang.read.toolbar.forward,"btnFwd",_1e));
_20.add("");
}
if(_1c!="defined5"&&CC.Mbox.enableSpamForwhand){
_20.add(UI.Toolbar.getButton("reportspam",gLang.read.toolbar.reportspam,"btnReportSpam",_1e));
}else{
if(CC.Mbox.enableSpamForwhand){
_20.add(UI.Toolbar.getButton("reportnotspam",gLang.read.toolbar.reportnotspam,"btnReportNotSpam",_1e));
}
}
if(CC.Mbox.enableSpamForwhand){
_20.add("");
}
_20.add(UI.Toolbar.getMenu("move",gLang.read.toolbar.move,"btnMov",_1e));
_20.add(UI.Toolbar.getMenuButton("del",gLang.read.toolbar.del,"btnDel",_1e));
_20.add("");
if(this.isRealFolder()){
_20.add(UI.Toolbar.getMenu("check",gLang.menu.view));
}
_20.add(UI.Toolbar.getMenu("more",gLang.menu.more));
_20.add("");
_20.add(UI.Toolbar.getButton("refresh",gLang.menu.refresh,"btnRefresh"));
var _21=initPageGo(_1c);
return [_20,_21];
}
function fFolder_getToolbarMenu(_22){
var obj=this;
var _24=obj.moduleName;
var _25=MM[_24].dg.HTML.getSelectTargetArray();
var _26=(_25.length>0);
var _27=(_25.length==1);
var fid=CC.getFidByModule(_24);
var _29=[];
switch(_22){
case "del":
_29=[{width:"100"},[gLang.read.toolbar["del"],function(){
obj.folderHandle("del");
}],[gLang.read.toolbar["realdel"],function(){
obj.folderHandle("reldel");
}]];
break;
case "reply":
_29=[{width:"120"},[gLang.read.toolbar["reply"],function(){
MM.read.setReplyContent(_24,"reply","folder");
}],[gLang.read.toolbar["replyall"],function(){
MM.read.setReplyContent(_24,"replyall","folder");
}]];
break;
case "forward":
_29=[{width:"150"},[gLang.read.toolbar["forward"],_27&&function(){
MM.read.setReplyContent(_24,"forward","folder");
}],[gLang.read.toolbar["forwardasattch"],function(){
MM.read.setReplyContent(_24,"forward_a","folder");
}],[gLang.read.toolbar["forwarddirectly"],_27&&function(){
MM.read.setReplyContent(_24,"forward_t","folder");
}]];
break;
case "move":
_29=fGetMoveToolbarMenu(this,fid);
break;
case "check":
_29=[{width:"130"},[gLang.read.toolbar["view_unread"],function(){
MM.folder.goSearch(1,_24);
}],[gLang.read.toolbar["view_read"],function(){
MM.folder.goSearch(5,_24);
}],"empty",[gLang.read.toolbar["view_replyed"],function(){
MM.folder.goSearch(2,_24);
}],"empty",[gLang.read.toolbar["view_forwarded"],function(){
MM.folder.goSearch(3,_24);
}]];
break;
case "more":
_29=[{width:"130"},[gLang.read.toolbar["more_reject"],_26&&function(){
obj.refuse();
}],"empty",[gLang.read.toolbar["more_markunread"],_26&&function(){
obj.folderHandle("setnew");
}],[gLang.read.toolbar["more_markread"],_26&&function(){
obj.folderHandle("setreaded");
}],[gLang.read.toolbar["more_markurgent"],_26&&function(){
obj.folderHandle("mer");
}],[gLang.read.toolbar["more_markslow"],_26&&function(){
obj.folderHandle("slow");
}],[gLang.read.toolbar["more_marknormal"],_26&&function(){
obj.folderHandle("normal");
}]];
if(_24!="deleted"&&_24!="defined5"&&_24!="defined6"&&_24!="defined7"){
_29.push("empty",[gLang.read.toolbar["more_sendagain"],_27&&function(){
MM.read.setReplyContent(_24,"sendagain","folder");
}]);
}
fReadMoreOptions(_24,_29,_27);
break;
}
return _29;
}
function fFolder_init(){
GE.currentFolder=this.moduleName;
this.getDataGrid();
this.setContentHeight();
this.readData=null;
try{
MM["folder"].bottomInit=true;
$win().vSplitterMove(70+GE.localConfig["con_bottom_height"]);
}
catch(exp){
}
}
MM["folder"].clear=function(){
this.dg.System.setData({});
this.dg.refresh();
this.p3.innerHTML=this.getPanelHtml();
this.setContentHeight();
this.readData=null;
};
function fFolder_setContentHeight(){
try{
var _2a=this.moduleName;
var _2b=$("MailListDiv"+_2a);
var _2c=_2b.firstChild.childNodes[0];
var _2d=_2b.firstChild.childNodes[1];
var _2e=$("dvVSplitter"+_2a);
var _2f=$("dvLetterContent"+_2a);
var _30=$("readMailHeaderTab"+_2a);
var _31=$("dvLetterContentText"+_2a);
var _32=$("ifrReadPart"+_2a);
this.p1=_2b;
this.p1_1=_2c;
this.p1_2=_2d;
this.p2=_2e;
this.p3=_2f;
this.p3_1=_30;
this.p3_2=_31;
this.p3_2_1=_32;
var arr=["p1","p1_1","p1_2","p2","p3","p3_1","p3_2","p3_2_1"];
fSetPartEvent.call(this,_2a,arr);
this.resize();
}
catch(exp){
fDebug("",exp);
}
}
function fFolder_resize(){
var _34=this.moduleName;
var _35=GE.leftHeight-this.p1.offsetHeight-7;
if(_35<0){
_35=0;
}
if(GE.readType=="0"){
this.p2.onmousedown=$win().vSplit;
this.p3.setH(_35);
var _36=this.p3.getH()-this.p3_1.getH()-8;
if(_36<0){
_36=0;
}
this.p3_2.setH(_36);
this.p3_2_1.setH(_36-2);
}else{
}
}
function fFolder_getDataGrid(_37){
_37=this.moduleName;
var _38=$("MailListDiv"+_37);
var a30=(_37=="draft"||_37=="sended")?gLang.read.grid["rcpt"]:gLang.read.grid["from"];
var a32=String.format(gLang.read.grid.orderby_fmt,a30);
var _3b=[];
_3b[0]=["","",,"",false,"fDGClick",0,"fDGClick"];
_3b[1]=["","",,"",false,"fDGClick",0,"fDGClick"];
_3b[2]=[a30,"",a32,"from",true,"fDGClick",0,"fDGClick"];
_3b[3]=["","",,"",false,"fDGClick",0,"fDGClick"];
_3b[4]=[gLang.read.grid["sub"],"",gLang.read.grid["orderby_sub"],"subject",true,"fDGClick",0,"fDGClick"];
_3b[5]=[gLang.read.grid["date"],"",gLang.read.grid["orderby_date"],"date",true,"fDGClick",0,"fDGClick"];
_3b[6]=[gLang.read.grid["size"],"",gLang.read.grid["orderby_size"],"size",true,"fDGClick",0,"fDGClick"];
_3b[7]=["","",,"",false,"fDGClick",0,"fDGClick"];
_3b[8]=["","",,"",false,"fDGClick",0,"fDGClick"];
var aDL=[];
var aLW=[];
var _3e=window.screen.width;
if(_3e==800){
aLW=[[0,10,4],[12,19,26],[38,141,166],[40000,40000,40000],[181,210,380],[391,95,473],[484,84,556],[564,10,570],[576,16,590]];
aDL=[13,16,126,16,215,95,84,12,16];
}else{
aLW=[[0,10,4],[12,19,26],[38,161,186],[40000,40000,40000],[201,310,500],[511,95,593],[604,84,676],[684,10,690],[696,16,710]];
aDL=[13,16,146,16,315,95,84,12,16];
}
var _3f=[];
_3f[0]=[aLW[0][0],aLW[0][1],aLW[0][2],"msgTableHeaders","btnS rm_tableIconHeader importantIcon"];
_3f[1]=[aLW[1][0],aLW[1][1],aLW[1][2],"msgTableHeaders","btnS rm_tableIconHeader readIco"];
_3f[2]=[aLW[2][0],aLW[2][1],aLW[2][2],"msgTableHeadersSortable"];
_3f[3]=[aLW[3][0],aLW[3][1],aLW[3][2],"msgTableHeaders"];
_3f[4]=[aLW[4][0],aLW[4][1],aLW[4][2],"msgTableHeadersSortable"];
_3f[5]=[aLW[5][0],aLW[5][1],aLW[5][2],"msgTableHeadersSortable"];
_3f[6]=[aLW[6][0],aLW[6][1],aLW[6][2],"msgTableHeadersSortable","aRight"];
_3f[7]=[aLW[7][0],aLW[7][1],aLW[7][2],"msgTableHeaders","btnS rm_tableIconHeader attachmentIcon"];
_3f[8]=[aLW[8][0],aLW[8][1],aLW[8][2],"msgTableHeaders"];
var _40=[];
_40[0]=[aDL[0],"tableViewCell tableViewCellPaddingVert",true,false];
_40[1]=[aDL[1],"tableViewCell",true,false];
_40[2]=[aDL[2],"tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz",false,true];
_40[3]=[aDL[3],"tableViewCell",true,false];
_40[4]=[aDL[4],"tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz",false,true];
_40[5]=[aDL[5],"tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz",false,true];
_40[6]=[aDL[6],"tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz aRight",false,true];
_40[7]=[aDL[7],"tableViewCell tableViewCellPaddingVert",true,false];
_40[8]=[aDL[8],"tableViewCell tableViewCellPaddingVert tableViewCellPaddingHoriz",true,false];
var _41=[];
var oDG=this.dg=new UI.DataGrid();
oDG.getDataSpec=function(a){
if(a[3]==""){
a[3]=gLang.read.none;
}
if(a[2]==""){
a[2]=gLang.read.none;
}
return {isNew:a[1]==5,mailFlags:["P","I",,"V",,,,"A"],text:[,,a[2],,a[3],a[4],a[5]+"&nbsp;",,"tableIcon btnS popColor"+a.backgroundColor],title:[,,a[12],,,a[6],,,]};
};
oDG.parentModule=this;
oDG.System.setParentNode(_38);
oDG.System.sortColumn=5;
oDG.System.sortBy=oDG.CSS.dgTitleDownHTML;
oDG.CSS.setTitleCSS(_3f);
oDG.CSS.setDataCSS(_40);
oDG.System.setTitle(_3b);
oDG.System.setData(_41);
oDG.HTML.setContainerOnClick(fFolder_fDG_ContainerClick.bind(this));
oDG.HTML.setDataOnClick(fFolder_fDG_Click);
oDG.HTML.setDataOnMouseDown(fMailMouseDown);
oDG.HTML.setDataOnContextmenu(fFolder_fDG_ContextMenu);
oDG.create();
}
function fFolder_synData(_44){
GE.currentFolder=_44;
}
function fFolder_fDG_ContainerClick(_45,_46){
var _47=this;
var dg=_47.dg;
if(Event.element(_46||$win().event)==_45){
_47.p3.innerHTML=_47.getPanelHtml();
_47.setContentHeight();
_47.readData=null;
dg.selectAll(false);
}
}
function fFolder_fDG_Click(ev){
var o=Event.findElement(ev,"TABLE");
var _4b=DG.parentModule.moduleName;
if((new Date()).valueOf()-GE.time.valueOf()<600){
GE.time=new Date();
return;
}
GE.time=new Date();
if(!ev.ctrlKey&&!ev.shiftKey){
fReadLetter(o.readUrl.htmldecode(),_4b);
}
}
function fFolder_readByContextMenuByNewWin(){
var win=window.open(CC.getURL("newread.htm"));
}
function fFolder_printPage(_4d){
var _4e=fReadPeekLetter(_4d);
if(_4e!=null){
window.open(CC.getURL("mailprint.html?letter="+_4e.module));
}
}
function fFolder_readByContextMenuByNewTab(){
this.operate("open");
}
function fFolder_fDG_ContextMenu(ev){
var _50=DG.parentModule.moduleName;
var f=$win();
var _52=MM[_50].dg.HTML.getSelectTargetArray();
var _53=(_52.length==1);
var o=[{width:"150",top:Event.pointerY(ev),left:Event.pointerX(ev)}];
o[o.length]=[gLang.read.menu["open"],_53&&function(){
MM[_50].readByContextMenuByNewTab();
}];
o[o.length]=[gLang.read.menu["openwin"],_53&&function(){
MM[_50].readByContextMenuByNewWin();
}];
o[o.length]=[gLang.read.menu["print"],_53&&function(){
fFolder_printPage(_50);
}];
o[o.length]="empty";
if(CM.User.cos.perm_webmail_sendmail){
o[o.length]=[gLang.read.menu["reply"],_53&&function(){
MM.read.setReplyContent(_50,"reply","folder");
}];
o[o.length]=[gLang.read.menu["replyall"],_53&&function(){
MM.read.setReplyContent(_50,"replyall","folder");
}];
o[o.length]="empty";
}
if(CM.User.cos.perm_webmail_sendmail){
o[o.length]=[gLang.read.menu["forward"],_53&&function(){
MM.read.setReplyContent(_50,"forward","folder");
}];
o[o.length]=[gLang.read.menu["forwardatt"],function(){
MM.read.setReplyContent(_50,"forward_a","folder");
}];
o[o.length]=[gLang.read.menu["forwarddirectly"],_53&&function(){
MM.read.setReplyContent(_50,"forward_t","folder");
}];
o[o.length]="empty";
}
if(_50!="deleted"&&_50!="defined5"&&_50!="defined6"&&_50!="defined7"){
o[o.length]=[gLang.read.menu["sendagain"],_53&&function(){
MM.read.setReplyContent(_50,"sendagain","folder");
}];
o[o.length]="empty";
}
o[o.length]=[gLang.read.menu["markread"],function(){
MM[_50].folderHandle("setreaded");
}];
o[o.length]=[gLang.read.menu["markunread"],function(){
MM[_50].folderHandle("setnew");
}];
o[o.length]="empty";
o[o.length]=[gLang.read.menu["del"],function(){
MM[_50].folderHandle("del");
}];
if(_50!="defined5"){
o[o.length]=[gLang.read.menu["refuse"],function(){
MM[_50].refuse();
}];
}
var dg=MM[_50].dg;
o.push("empty",[gLang.GLOBAL.sel_all,dg.selectAll.bind(dg,true)]);
CMenu.create(o);
MM[_50].operate("read");
}
function initGotoPageFAL(_56){
if(_56==GE.laterRequestModule){
MM.showToolbar(_56);
}
}
function initPageGo(_57){
var d=CM[_57];
var n=d.getCurPage();
var sum=d.getPageCount();
var _5b="<select class=\"tlSel fbk3\" id=\"selPages"+_57+"\" onchange=\"fGoto('CM."+_57+".goPageN', this.value)\">";
for(var i=0;i<sum;i++){
_5b+="<option value=\""+i+"\""+(i==n?" selected":"")+">"+(i+1)+" / "+sum+"</option>";
}
_5b+="</select>";
return _5b;
}
function fMoveLettersByDrop(to){
try{
var _5e=GE.laterRequestModule;
if(_5e==to){
return;
}
if(to.indexOf("nf")>-1){
MM["nf"].move(parseInt(to.replace(/nf/g,""),10));
return;
}
if(!window.confirm(String.format(gLang.folder.msg.confirm_movehere,MM[to].name))){
return;
}
this.move(CC.getFidByModule(to));
MBOX_reload();
}
catch(exp){
fDebug("fMoveLettersByDrop",exp);
}
}
function fGetDragItem(){
var _5f=MM[GE.currentFolder].dg.HTML.getSelectTargetArray();
var obj=$("dvDragItem");
if(obj){
obj.parentNode.removeChild(obj);
}
obj=El.createElement("DIV");
obj.id="dvDragItem";
El.setStyle(obj,{"position":"absolute","zIndex":"99","display":"none"});
var _61="";
if(_5f.length==1){
var tb=_5f[0];
var row=tb.rows[0];
_61=row.cells[4].innerHTML;
}else{
if(_5f.length>1){
_61=String.format(gLang.GLOBAL["tab_letterUnit"],_5f.length);
}
}
obj.innerHTML="<div id=\"Layer1\" class=\"border2 bgcolor2 dragDiv\" >"+"<div class=\"dragIconBot bgcolor6\" >"+"<div class=\"icoBtn4 btnS btnNoMov\" id=\"moveIcon\"></div>"+"</div>"+"<div  class=\"dragCont\">"+"<table  class=\"dragContTB\"><tr><td ><nobr>"+_61+"</nobr></td></tr></table>"+"</div></div>";
obj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=70)";
$doc().body.appendChild(obj);
$("moveIcon").isNoDrop=true;
}
function fMailMouseDown(ev){
var _65=MM[GE.currentFolder].dg.HTML.getSelectTargetArray();
if(_65.length==0){
return;
}
gSourceDiv=this;
var _66=Event.element(ev);
if(_66.tagName=="INPUT"){
return;
}
gSourceDiv.mouseDownY=ev.clientY;
gSourceDiv.mouseDownX=ev.clientX;
gBeginMoving=true;
fGetDragItem();
var _67=$("dvDragItem");
_67.style.top=ev.clientY-10;
_67.style.left=ev.clientX-10;
$doc().body.onselectstart=function(){
return false;
};
$win().fGetContentLayer(MM[GE.currentFolder].p3_2);
}
function fReadLetter(_68,_69){
var mid=CC.getMidByUrl(_68);
var _6b;
if(arguments[2]){
_6b=arguments[2];
}
if(_69=="draft"&&GE.isLetterDbClick&&CM.User.cos.perm_webmail_sendmail){
var _6c="compose";
var _6d=UI.Tab.tabs;
for(var t in _6d){
if(UI.Tab.exist(t)&&t.indexOf(_6c)==0&&MM[t].type=="draft"&&mid==MM[t].mid&&MM[t].empty()){
_6d[t].onclick();
GE.isLetterDbClick=false;
return;
}
}
MM.execute("compose",function(){
CM.restoreDraft(mid,_6b);
GE.isLetterDbClick=false;
});
return;
}
var mmm=MM[_69];
if(!GE.isLetterDbClick&&MM[_69].readData&&mid==MM[_69].readData.mid){
return;
}
if(GE.isLetterDbClick){
fLoadLetter(_68,_69);
}else{
clearTimeout(fReadLetter.task);
fReadLetter.task=setTimeout("fLoadLetter(\""+_68+"\", \""+_69+"\", false);",100);
}
}
function fLoadLetter(_70,_71){
var mid=CC.getMidByUrl(_70);
if(true){
for(var o in CM["letter"]){
if(mid==CM["letter"][o].mid){
fGetCacheLetter(o);
MM["folder"].mark("setreaded");
return;
}
}
}
CMXMail.loadEMail(mid,_71);
if(!GE.isLetterDbClick){
GE.laterRequestModule=_71;
}
function fGetCacheLetter(o){
var _75=GE.laterRequestModule.indexOf("letter")==0;
if(_75){
CM["read"]=CM["letter"][o].data;
MM.createModule("read");
}else{
if(!GE.isLetterDbClick){
CM["read"]=CM["letter"][o].data;
MM["read"].moduleName=o;
MM.createModule("read");
MM[GE.currentFolder].readData=CM["letter"][o];
MM["read"].moduleName="read";
}else{
if(MM[o]){
MM.getModule(o);
GE.isLetterDbClick=false;
}else{
GE.laterRequestModule=o;
MM.createModule(o);
}
}
}
}
}
function fFolder_Delete(_76){
var _77=this.moduleName;
var _78=false;
if(_76=="del"&&_77!="deleted"){
MM["deleted"].load=false;
}else{
if(_76=="reldel"||(_76=="del"&&_77=="deleted")){
if(!confirm(gLang.read["confirm_del_mails"])){
return;
}
_78=true;
}
}
if(_78){
CMXMail.deleteMail(this,"fromfolder");
}else{
CMXMail.moveMail(this,gInboxFlag["deleted"],"fromfolder");
}
}
function fFolder_refuse(){
var _79=this.moduleName;
var arr=[];
var _7b=MM[_79].dg.HTML.getSelectTargetArray();
for(var i=0;i<_7b.length;i++){
var _7d=_7b[i].chkName;
var p=_7d.indexOf("_");
_7d=EmailAddress.parseSingleEmail(_7d.substr(p+1));
if(_7d!=""){
arr[arr.length]=_7d;
}
}
if(arr.length==0){
return;
}
var _7f="f:CMXMail.setBlackMailList(\""+arr.join(",")+"\")";
MM["refuselist"].load=false;
var _80=MM["refuselist"].cmURL;
MM["refuselist"].cmURL=_7f;
MM.execute("refuselist");
GE.laterRequestModule="refuselist";
}
function fFolder_report(_81){
var _82=this.moduleName;
if(_82=="unRead"){
MM["inbox"].load=false;
}
var _83=_81?"defined5":"inbox";
var _84=gInboxFlag[_83];
MM[_83].load=false;
CMXMail.moveMail(this,_84,"fromfolder",null,_81);
}
function fFolder_mark(_85){
var _86=this.moduleName;
var frm=$("frmHeaderList"+_86);
var _88=-1;
if(_85=="setnew"){
_88=5;
}else{
if(_85=="setreaded"){
_88=6;
}else{
if(_85=="slow"){
_88=9;
}else{
if(_85=="normal"){
_88=8;
}else{
if(_85=="mer"){
_88=7;
}
}
}
}
}
CMXMail.changeMailStatus(_85,_88);
}
function fFolder_move(_89){
var _8a=this.moduleName;
if(_8a=="unRead"){
MM["inbox"].load=false;
}
var _8b=CC.getModuleByFid(_89);
MM[_8b].load=false;
CMXMail.moveMail(this,_89,"fromfolder");
}
function fFolderHandle(_8c){
var _8d=this.moduleName;
if(_8c==""){
return;
}else{
if(_8c=="refresh"){
return this.refresh();
}
}
var _8e=_8c,fid;
if(_8c=="open"){
_8e="read";
GE.isLetterDbClick=true;
}else{
if(_8c=="preview"){
_8e="read";
GE.isLetterDbClick=false;
}else{
if(_8c.indexOf("folder_")>-1){
_8e="move";
fid=_8c.split("_")[1];
}
}
}
switch(_8e){
case "read":
var url=this.dg.HTML.getSelectTarget().readUrl.htmldecode();
fReadLetter(url,_8d);
break;
case "reldel":
case "del":
this.del(_8e);
break;
case "mer":
case "normal":
case "slow":
case "setreaded":
case "setnew":
case "toggleread":
this.mark(_8e);
break;
case "reply":
MM.read.setReplyContent(_8d,"reply","folder");
break;
case "forward":
MM.read.setReplyContent(_8d,"forward","folder");
break;
case "move":
if(!fid){
fid=arguments[1];
}
this.move(fid);
break;
case "reportspam":
this.report(true);
break;
case "reportnotspam":
this.report(false);
break;
}
}
function fSetPartEvent(_90,arr){
try{
for(var i=0;i<arr.length;i++){
this[arr[i]].part=arr[i];
this[arr[i]].getH=function(){
return this.offsetHeight;
};
this[arr[i]].setH=function(h){
this.style.height=parseInt(h+"",10)+"px";
};
this[arr[i]].reflesh=function(){
var _94=this.getH;
var _95=this.setH;
var _96=this.reflesh;
var _97=this.part;
MM[_90][this.part]=$(this.id);
MM[_90][this.part].getH=_94;
MM[_90][this.part].setH=_95;
MM[_90][this.part].reflesh=_96;
MM[_90][this.part].part=_97;
};
}
}
catch(exp){
}
}
function fFolder_goSearch(_98,_99){
var _9a={field:"flags",operator:"contains",operand:{}};
switch(_98){
case 1:
_9a.operand.read=false;
break;
case 5:
_9a.operand.read=true;
break;
case 2:
_9a.operand.replied=true;
break;
case 3:
_9a.operand.forwarded=true;
break;
default:
UI.alert(gLang.searchmail.msg["msg_searchNoSubtype"]);
return;
}
var s=new CM$Search();
s.setFolder(_99);
s.setCondictions(_9a);
s.exec();
}
function fFolder_removeLetters(_9c,_9d,_9e){
var _9f=this.moduleName;
var dg=MM[_9f].dg;
var _a1=dg.System.getData();
var _a2=0;
var _a3=-1;
if(_9c=="fromfolder"){
_a2=dg.HTML.getSelectTargetArray().length;
}else{
_a2=1;
}
for(var i=0;i<_a1.length;i++){
if(_9d.indexOf(_a1[i][9].replace(/%0A.+/,""))!=-1){
_a3=i;
break;
}
}
if(_9e!=null){
CM.MBOX.getFolderItem(_9e).stats.messageCount+=_a2;
var _a5=CC.getModuleByFid(_9e,"inbox");
MM[_a5].load=false;
}
if(_9c=="fromfolder"){
CM[_9f].loadPage(_a3);
}else{
MM[_9f].load=false;
}
if(_9f!="unRead"){
CM.MBOX.getFolderItem(CM[_9f].fid).stats.messageCount-=_a2;
MBOX_folderChanged();
}else{
MBOX_reload();
}
}
function fFolder_getNewSubmitFrame(frm){
var _a7=frm.target;
if(!this.index){
this.index=1;
}else{
this.index++;
}
var _a8=this.moduleName+"_submit_"+this.index;
fGetCMFrame(_a8);
frm.target=_a8;
frm.submit();
frm.target=_a7;
}
function fFolder_changeMailStatus(_a9){
var dg=MM[GE.currentFolder].dg;
var arr=dg.HTML.getSelectTargetArray();
var _ac=0;
for(var i=0;i<arr.length;i++){
var _ae=dg.System.getData();
var x=_ae.length-arr[i].index-1;
var a=_ae[x];
if(_a9==5){
if(a[1]!=5){
a.lastStatus=a[1];
a[1]=5;
_ac++;
}
}else{
if(_a9==6){
if(a[1]==5){
a[1]=a.lastStatus?a.lastStatus:6;
_ac--;
}
}else{
if(_a9==7){
a.priority=1;
}else{
if(_a9==8){
a.priority=3;
}else{
if(_a9==9){
a.priority=5;
}
}
}
}
}
dg.HTML.changeMailStatus(x);
}
if(_a9==5||_a9==6){
MBOX_updateUnread(CC.getFidByModule(GE.currentFolder),_ac);
}
}
function fFolder_changeMailStatusByMid(mid,_b2){
var dg=MM[GE.currentFolder].dg;
var _b4=dg.System.getData();
mid=mid.replace(/%0A.+/,"");
for(var i=0;i<_b4.length;i++){
var a=_b4[i];
var _b7=CC.getMidByUrl(a[7]);
if(_b7==mid){
var _b8=-1;
switch(_b2){
case "new":
if(a[1]!=5){
a.lastStatus=a[1];
a[1]=5;
MBOX_updateUnread(CC.getFidByModule(GE.currentFolder),1);
}
break;
case "readed":
if(a[1]==5){
a[1]=a.lastStatus?a.lastStatus:6;
MBOX_updateUnread(CC.getFidByModule(GE.currentFolder),-1);
}
break;
case "reply":
if(a[1]!=4){
a[1]=3;
}else{
a[1]=2;
}
break;
case "forward":
if(a[1]!=3){
a[1]=4;
}else{
a[1]=2;
}
break;
default:
return;
}
dg.HTML.changeMailStatus(i);
return;
}
}
}
function Read_init(){
MM["read"].midReplyMapping=new Object();
MM["read"].midForwardMapping=new Object();
MM["read"].midSendAgainMapping=new Object();
MM["read"].index=0;
MM["read"].deletedLetter=[];
MM["read"].moduleName="read";
MM["read"].operateRead="";
MM["read"].addAddress=fRead_addAddress;
MM["read"].refuse=fRead_refuse;
MM["read"].openNewWin=fRead_openNewWin;
MM["read"].getHtml=fRead_getHtml;
MM["read"].getprintHtml=fRead_getprintHtml;
MM["read"].getPanelHtml=fRead_getHtml;
MM["read"].getToolbar=fRead_getToolbar;
MM["read"].getToolbarMenu=fRead_getToolbarMenu;
MM["read"].init=fRead_init;
MM["read"].resize=fRead_resize;
MM["read"].operate=fRead_operate;
MM["read"].readOperateAgen=fRead_readOperateAgen;
MM["read"].replyHead=fRead_replyHead;
MM["read"].forwardHead=fRead_forwardHead;
MM["read"].part=fRead_part;
MM["read"].isDeleted=fRead_isDeleted;
MM["read"].setReplyContent=fRead_setReplyContent;
MM["read"].attachOption=fRead_attachOption;
}
Read_init();
function fRead_addAddress(_b9,_ba){
var _bb=fReadPeekData(_b9);
if(_bb){
var d=_bb.urls["addaddr"];
CMXMail.addUserAddress(d[0],d[1],_ba);
}
}
function fReadPeekData(_bd){
if(_bd.indexOf("letter")>-1){
return CM["letter"][_bd].data;
}else{
if(MM[_bd].readData){
return MM[_bd].readData.data;
}else{
return null;
}
}
}
function fReadPeekLetter(_be){
if(_be.indexOf("letter")>-1){
return CM["letter"][_be];
}else{
if(MM[_be].readData){
return MM[_be].readData;
}else{
return null;
}
}
}
function fRead_refuse(_bf){
var _c0=fReadPeekData(_bf);
if(_c0){
var _c1="refuselist";
var _c2=_c0.from;
_c2=_c2.htmldecode();
_c2=_c2.replace(/.*</g,"").replace(/>.*/g,"");
MM[_c1].email=_c2;
MM[_c1].load=false;
MM.execute(_c1);
}
}
function fRead_openNewWin(url,_c4,_c5){
GE.isLetterDbClick=true;
fReadLetter(url.htmldecode(),_c4);
}
function fRead_getprintHtml(_c6){
var d=CM["letter"][_c6].data;
var _qq={"text":function(x){
return x;
},"html":function(x){
return "<b>"+x+"</b>";
}};
var br="<br />";
var _q=d.getMimeInfo().html?_qq["html"]:_qq["text"];
var _cd=d.getMimeInfo().html?d.from:d.from.unescapeHTML();
var to=d.getMimeInfo().html?d.to:d.to.unescapeHTML();
var cc=d.getMimeInfo().html?d.cc:d.cc.unescapeHTML();
var s="";
s+=_q(gLang.compose.replyheader["from"])+" "+_cd+br;
s+=_q(gLang.compose.replyheader["senttime"])+" "+(d.date?d.date.formatDateTime():"")+br;
s+=_q(gLang.compose.replyheader["to"])+" "+to+br;
s+=_q(gLang.compose.replyheader["cc"])+" "+cc+br;
s+=_q(gLang.compose.replyheader["subject"])+" "+d.subject+br;
s+=gLang.compose.replyheader["printcontent"]+br;
var _d1="<div>"+s+"</div>";
_d1+="<div style=\"height:160px;\" id=\"ifrReadPart\">"+CM["read"].getHTML()+"</div>";
return _d1;
}
function fRead_getHtml(){
var _d2=this.moduleName;
var d=CM[_d2]||CM["letter"][_d2].data;
if(!_d2||_d2=="read"){
_d2="letter"+MM["read"].index;
MM["read"].index++;
}
var f=GE.currentFolder;
if(GE.isLetterDbClick){
f=_d2;
}
CM["letter"][_d2]={};
CM["letter"][_d2].cmURL=d.readUrl;
CM["letter"][_d2].mid=d.mid?d.mid.replace(/%0A.+/,""):undefined;
CM["letter"][_d2].postmid=d.mid;
CM["letter"][_d2].data=d;
CM["letter"][_d2].module=_d2;
var _d5="";
var _d6=d.from;
if(CC.User.supportPAB){
if(GE.address!=null){
var s=GE.address.set;
if(!s){
s={N:{},E:{}};
var Add=GE.address;
for(var i=0;i<Add.length;++i){
s.N[Add[i][0]]=i+1;
s.E[Add[i][1]]=Add[i][0];
}
GE.address.set=s;
}
if(s.E[d.urls["addaddr"][0]]||s.N[d.urls["addaddr"][1]]){
_d5="&nbsp;";
}
if(s.E[_d6]){
_d6="\""+s.E[_d6]+"\" &lt;"+_d6+"&gt;";
}
}
if(!_d5){
_d5="<a id=\"opAddaddr\" href=\"javascript:fGoto()\" onclick='fGoto(\"MM.read.addAddress\", \""+f+"\",\"a\")'><span class=\"btnS icoAdd\">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class=\"fnoml fgn3\">"+gLang.read.page.addaddress+"</span></a>";
}
}
var _da="<div class=\"bgF2 readMailHeaderBG\" ></div>"+"<span id=\"spnReadArea\">"+"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  class=\"readMailHeaderTable bgcolor2 fbk3\" id=\"readMailHeaderTab"+f+"\" name=\"readMailHeaderTab\">"+"<tr>"+"<td class=\"readMailHeaderCont fbold\"><span id=\"readSubject\">"+d.subject+"</span><a href=\"javascript:fGoto()\" onclick=\"fGoto('MM."+f+".readByContextMenuByNewWin');return false;\"><span class=\"btnS icoNewWin\">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class=\"fnoml fgn3\">"+gLang.read.page["openwin"]+"</span></a>"+"</td>"+"<td width=\"210\" align=\"right\" class=\"readMailHeaderCont\">"+"<div id=\"icoUp\" class=\"btnS icoUp\" style=\"display:block\" onclick=\"fToggleReadMore('moreCont"+f+"','"+f+"', this)\"></div>"+"<div id=\"icoDown\" class=\"btnS icoDown\" style=\"display:none\"></div>"+"</td>"+"</tr>"+"<tr>"+"<td class=\"readMailHeaderCont fbk\"><b>"+gLang.read.page.from+"</b> "+(_d6?fSetFromFormat(_d6)+(fIsMe(d.from.unescapeHTML())?"":_d5+"<a id=\"opRefuse\" href=\"javascript:fGoto()\" onclick='fGoto(\"MM.read.refuse\",\""+f+"\")'><span class=\"btnS icoRef\">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class=\"fnoml fgn3\">"+gLang.read.page.reject+"</span></a>"+fGetInviteHtml(d,f)):"")+"</td>"+" <td align=\"right\" valign=\"top\"  class=\"fgy readMailHeaderCont\"  >"+fReadMakeDate(d.date)+"</td></tr>"+"<tr >"+"<td colspan=\"2\"  class=\"fbk3\" >"+"<div style=\"display:block;\" class=\"bgcolor5 readMailHeaderCont\" id=\"moreCont"+f+"\">"+"<table><tr>"+"<td width=\"50\" height=\"20\" class=\"readMailHeaderPad1 fbk3 fBold\" valign=\"top\" nowrap>"+gLang.read.page.to+"</td>"+"<td class=\"readMailHeaderPad2\">"+fGetPartRcpts("to",_d2)+fGetAllRcpts("to",_d2)+"</td>"+"</tr>"+"<tr><td height=\"20\" class=\"readMailHeaderPad1 fbk3 fBold\" valign=\"top\" nowrap>"+gLang.read.page.cc+"</td>"+"<td class=\"readMailHeaderPad2\">"+fGetPartRcpts("cc",_d2)+fGetAllRcpts("cc",_d2)+"</td>"+"</tr></table>"+"</div></td></tr>"+"<tr>"+"<td colspan=\"2\"  class=\"readMailHeaderCont fbk3 border1\" id=\"readAttachs\">";
if(d.attach.length>0){
var id=d.getMid();
var _dc=id.substring(0,id.indexOf(":"));
var mid=id.substring(id.indexOf(":")+1);
_da+="<table width=\"100%\"><tr>"+"<td width=\"50\" height=\"25\" valign=\"top\" class=\"readMailHeaderPad1 fbk3 fBold\" >"+gLang.read.page.attach+"</td>"+"<td valign=\"top\" class=\"readMailHeaderPad2\">"+fGetPartAttaches(_d2,f)+fGetAllAttaches(_d2,f)+fPackAttaches(_d2)+"</td></tr></table>";
}
_da+="</td></tr></table></span>";
_da+="<div style=\"height:160px;\" id=\"dvLetterContentText"+f+"\">";
if(!CM["letter"][_d2].data.ifrm){
_da+="<iframe id=\"ifrReadPart"+f+"\" name=\"ifrReadPart"+f+"\" scrolling=\"auto\"  src=\"about:blank\"  style=\"width:100%;height:100%\" frameborder=\"0\"></iframe>";
}
_da+="</div>";
CM["letter"][_d2].html="";
MM["read"].currentData=CM["letter"][_d2];
if(GE.isLetterDbClick){
_da="<div class=\"border1\" style=\"height:238px; height:239px;overflow:auto\" id=\"dvBorder"+f+"\">"+_da+"</div>";
_da=_da.replace(gLang.read.page["openwin"],"").replace("btnS icoNewWin","");
}else{
MM[f].readData=CM["letter"][_d2];
}
return _da;
}
function fRead_getToolbar(_de){
var _df=[new toolbarOption("reply",gLang.read.toolbar["reply"],"fGoto('MM.read.setReplyContent','"+_de+"','reply' , 'read')",false,true,false,"btnRe","tlbtn2",true),new toolbarOption("forward",gLang.read.toolbar["forward"],"fGoto('MM.read.setReplyContent','"+_de+"','forward' , 'read')",false,true,true,"btnFwd","tlbtn2",true),new toolbarOption("move",gLang.read.toolbar["move"],"",true,false,false,"btnMov","tlbtn2",true),new toolbarOption("del",gLang.read.toolbar["del"],"fGoto('MM.read.readOperateAgen','"+_de+"','del')",false,true,true,"btnDel","tlbtn2",true),new toolbarOption("pre",gLang.read.toolbar["pre"],"fGoto('MM.read.readOperateAgen','"+_de+"','pre')",false,false,false,"btnPre","tlbtn2",true),new toolbarOption("next",gLang.read.toolbar["next"],"fGoto('MM.read.readOperateAgen','"+_de+"','next')",false,false,false,"btnNet","tlbtn2",true),new toolbarOption("more",gLang.menu["more"],"",true,false,false,"","tlbtn1",false)];
if(CM["letter"][_de].data.nested||!CM.User.cos.perm_webmail_sendmail){
_df[0].disabled=true;
_df[1].disabled=true;
}
if(!CM["letter"][_de].mid){
_df[2].disabled=true;
_df[3].disabled=true;
}
if(!CM["letter"][_de].data.urls["pre"]){
_df[4].disabled=true;
}
if(!CM["letter"][_de].data.urls["next"]){
_df[5].disabled=true;
}
return [_df,""];
}
function fRead_getToolbarMenu(_e0){
var _e1=this.moduleName;
var fid=CM["letter"][_e1].data.fid;
var obj=this;
var _e4=[];
switch(_e0){
case "del":
_e4=[{width:"120"},[gLang.read.toolbar["del"],function(){
obj.operate("del");
}],[gLang.read.toolbar["realdel"],function(){
obj.operate("reldel");
}]];
break;
case "reply":
_e4=[{width:"120"},[gLang.read.toolbar["reply"],function(){
MM.read.setReplyContent(_e1,"reply","read");
}],[gLang.read.toolbar["replyall"],function(){
MM.read.setReplyContent(_e1,"replyall","read");
}]];
break;
case "forward":
_e4=[{width:"150"},[gLang.read.toolbar["forward"],function(){
MM.read.setReplyContent(_e1,"forward","read");
}],[gLang.read.toolbar["forwardasattch"],function(){
MM.read.setReplyContent(_e1,"forward_a","read");
}],[gLang.read.toolbar["forwarddirectly"],function(){
MM.read.setReplyContent(_e1,"forward_t","read");
}]];
break;
case "move":
_e4=fGetMoveToolbarMenu(this,fid);
break;
case "more":
_e4=[{width:"130"},[gLang.read.toolbar["more_reject"],function(){
obj.refuse(obj.moduleName);
}]];
var _e5=fGetModuleByFid(fid);
if(_e5!="deleted"&&_e5!="defined5"&&_e5!="defined6"&&_e5!="defined7"&&CM.User.cos.perm_webmail_sendmail){
_e4.push("empty",[gLang.read.toolbar["more_sendagain"],function(){
MM.read.setReplyContent(_e1,"sendagain","read");
}]);
}
fReadMoreOptions(obj.moduleName,_e4,true);
break;
}
return _e4;
}
function fReadMoreOptions(_e6,_e7,_e8){
var _e9=_e8?fReadPeekData(_e6):null;
if(!_e9){
_e8=false;
_e8=false;
}
function encodingOption(enc,_eb){
return {text:_eb||enc,action:function(){
_e9.encoding=enc;
_e9.read(_e6);
},selected:_e9.encoding==enc};
}
_e7.push("empty",[gLang.read.toolbar["more_viewhead"],_e8&&function(){
_e9.readHeaderRaw();
}],[gLang.read.toolbar["more_viewsrc"],_e8&&function(){
_e9.readMimeSource();
}],[gLang.read.toolbar["more_download"],_e8&&CM.User.cos.perm_webmail_mail_get_rfc&&function(){
_e9.download();
}],"empty",[gLang.read.toolbar["more_print"],_e8&&function(){
fFolder_printPage(_e6);
}],"empty",{text:gLang.read.toolbar["more_encoding"],submenu:function(){
return [{width:"120"},encodingOption("GBK"),encodingOption("HZ-GB-2312","HZ"),encodingOption("BIG5"),encodingOption("UTF8")];
},disabled:!_e8},[gLang.read.toolbar["more_displaypic"],_e8&&function(){
_e9.filterImages=!_e9.filterImages;
_e9.read(_e6);
},_e8&&!_e9.filterImages]);
_e7[0].width="160";
}
function fGetMoveToolbarMenu(_ec,fid,_ee){
var _ef=[{width:"150"}];
var _f0=16;
_ee=_ee||CM.MBOX;
var _f1=(_ee.getLastSystemFid||Prototype.emptyFunction)();
_ee.allFolders().each(function(fi){
var _f3=fi.getPath().left(60);
if(_f3.len()>_f0){
_f0=_f3.len();
}
if(fi.id!=fid){
_ef[_ef.length]=[_f3.htmlencode(),function(){
_ec.operate("move",fi.id);
}];
}else{
_ef[_ef.length]=[_f3.htmlencode(),false];
}
if(fi.id==_f1){
_ef[_ef.length]="empty";
}
});
if(_ef[_ef.length-1]=="empty"){
_ef.length=_ef.length-1;
}
_ef[0].width=_f0*8;
return _ef;
}
function fRead_init(){
var _f4=this.moduleName;
GE.isLetterDbClick=false;
var _f5=$("readMailHeaderTab"+_f4);
var _f6=$("dvLetterContentText"+_f4);
var _f7=$("ifrReadPart"+_f4);
this.p3=this.div;
this.p3_1=_f5;
this.p3_2=_f6;
this.p3_2_1=_f7;
var _f8=this.p3.getElementsByTagName("IFRAME");
if(_f8.length>0){
if(MM["read"].currentData){
MM["read"].currentData.data.ifrm=_f8[0];
var _f9=_f8[0].cloneNode(true);
if(GE.IsIE&&gVersion<5.5){
this.p3_2.innerHTML=_f9.outerHTML;
}else{
this.p3_2.removeChild(_f8[0]);
this.p3_2.appendChild(_f9);
}
}
}else{
if(MM["read"].currentData&&MM["read"].currentData.data.ifrm){
if(GE.IsIE&&gVersion<5.5){
this.p3_2.innerHTML=MM["read"].currentData.data.ifrm.outerHTML;
}else{
var _f9=MM["read"].currentData.data.ifrm.cloneNode(true);
this.p3_2.appendChild(_f9);
}
this.p3_2_1=this.p3_2.firstChild;
}
}
var arr=["p3","p3_1","p3_2","p3_2_1"];
fSetPartEvent.call(this,_f4,arr);
this.resize();
if(!MM["read"].operateRead&&CM["letter"][_f4].mid){
fReadLetter(CM["letter"][_f4].cmURL.htmldecode(),GE.currentFolder);
}
GE.laterRequestModule=_f4;
this.dat=CM["letter"][_f4].data;
this.dat.readHTML(_f8[0]);
}
function fRead_initPanel(_fb){
with(MM[_fb]){
p3.innerHTML=MM["read"].getPanelHtml();
p3_1.reflesh();
p3_2.reflesh();
var _fc=p3.getElementsByTagName("IFRAME");
if(_fc.length>0){
if(MM["read"].currentData){
MM["read"].currentData.data.ifrm=_fc[0];
}
}else{
if(MM["read"].currentData&&MM["read"].currentData.data.ifrm){
p3_2.appendChild(MM["read"].currentData.data.ifrm);
}
}
p3_2_1=p3_2.firstChild;
fSetPartEvent.call(MM[_fb],_fb,["p3_2_1"]);
p3_2_1.reflesh();
p3_2.setH(p3.getH()-p3_1.getH()-8);
p3_2_1.setH(p3.getH()-p3_1.getH()-10);
MM["read"].currentData.data.readHTML(_fc[0]);
}
}
function fRead_resize(){
var _fd=this.moduleName;
with(MM[_fd]){
var h=GE.leftHeight-p3_1.getH()-6;
if(GE.IsIE){
h=h-2;
}
p3_2_1.setH(h-2);
p3_2.setH(h);
$("dvBorder"+_fd).style.height=GE.leftHeight+"px";
}
}
function fRead_operate(_ff){
var _100=this.moduleName;
var mod=this;
GE.isLetterDbClick=true;
if(this.isDeleted(_100)){
return;
}
GE.readOperating=true;
MM["read"].operateRead=_100;
switch(_ff){
case "move":
var fid=arguments[1];
if(!fid){
return;
}
var _103=CM["letter"][_100].data.fid;
CM["letter"][_100].data.fid=fid;
MM[CC.getModuleByFid(fid)].load=false;
MM[CC.getModuleByFid(_103)].load=false;
CMXMail.moveMail(this,fid,"fromletter",CM["letter"][_100].mid);
break;
case "del":
case "reldel":
var _103=CM["letter"][_100].data.fid;
var _104=gInboxFlag["deleted"];
var _105=false;
if(_ff=="del"&&_103!=_104){
MM["deleted"].load=false;
}else{
if(_ff=="reldel"||(_ff=="del"&&_103==_104)){
if(!confirm(gLang.read.msg["qry_realdelmail"])){
return;
}
_105=true;
}
}
CM["letter"][_100].data.fid=_104;
MM["deleted"].load=false;
var f="";
if(_103==1){
f="inbox";
}else{
f=CC.getModuleByFid(_103,"");
}
MM[f].load=false;
if(_105){
CMXMail.deleteMail(this,"fromletter",CM["letter"][_100].mid);
}else{
CMXMail.moveMail(this,gInboxFlag["deleted"],"fromletter",CM["letter"][_100].mid);
}
break;
case "pre":
CMXMail.selectPreMail(mod.dat);
break;
case "next":
CMXMail.selectNextMail(mod.dat);
break;
}
if(_ff=="move"||_ff=="del"){
MBOX_reload();
}
}
function fRead_readOperateAgen(_107,flag){
MM[_107].operate(flag);
}
function fRead_replyHead(d){
var b={"text":"\n","html":"<br>"};
var _qq={"text":function(x){
return x;
},"html":function(x){
return "<b>"+x+"</b>";
}};
var br=d.getMimeInfo().html?b["html"]:b["text"];
var _q=d.getMimeInfo().html?_qq["html"]:_qq["text"];
var from=d.getMimeInfo().html?d.from:d.from.unescapeHTML();
var to=d.getMimeInfo().html?d.to:d.to.unescapeHTML();
var cc=d.getMimeInfo().html?d.cc:d.cc.unescapeHTML();
var s="";
s+=gLang.compose.replyheader["orgmail"]+br;
s+=_q(gLang.compose.replyheader["from"])+" "+from+br;
s+=_q(gLang.compose.replyheader["senttime"])+" "+(d.date?d.date.formatDateTime():"")+br;
s+=_q(gLang.compose.replyheader["to"])+" "+to+br;
s+=_q(gLang.compose.replyheader["cc"])+" "+cc+br;
s+=_q(gLang.compose.replyheader["subject"])+" "+d.subject+br;
return s;
}
function fRead_forwardHead(_114,d){
var b={"text":"\n","html":"<br>"};
var _qq={"text":function(x){
return x;
},"html":function(x){
return "<b>"+x+"</b>";
}};
var br=_114?b["html"]:b["text"];
var _q=_114?_qq["html"]:_qq["text"];
var from=_114?d.from:d.from.unescapeHTML();
var to=_114?d.to:d.to.unescapeHTML();
var cc=_114?d.cc:d.cc.unescapeHTML();
var s="";
s+=gLang.compose.replyheader["orgmail"]+br;
s+=_q(gLang.compose.replyheader["from"])+" "+from+br;
s+=_q(gLang.compose.replyheader["senttime"])+" "+(d.date?d.date.formatDateTime():"")+br;
s+=_q(gLang.compose.replyheader["to"])+" "+to+br;
s+=_q(gLang.compose.replyheader["cc"])+" "+cc+br;
s+=_q(gLang.compose.replyheader["subject"])+" "+d.subject+br;
return s;
}
function fRead_part(win,_121){
var mod=null;
var _123=_121.replace("ifrReadPart","");
if(_121.indexOf("letter")>-1){
mod=CM["letter"][_123];
}else{
var _124=GE.laterRequestModule;
if(_124.indexOf("letter")>-1){
mod=CM["letter"][_124];
}else{
if(MM[_124].isFolder){
mod=MM[_124].readData;
}else{
return;
}
}
}
var doc=win.document.body;
var text="";
var html=doc.innerHTML;
if(document.all){
text=doc.innerText;
}else{
text=html.replace(/<br>/ig,"\n");
text=text.unescapeHTML();
}
mod.text=text;
mod.html=html;
}
function fRead_isDeleted(_128){
var b=0;
var _12a=MM["read"].deletedLetter.join("|");
if(_128.indexOf("letter")>-1){
b=_12a.indexOf(CM["letter"][_128].mid);
}else{
b=_12a.indexOf(MM[_128].readData.mid);
}
if(b>-1){
UI.alert(gLang.read.msg["msg_maildeleted"]);
if(_128.indexOf("letter")>-1){
UI.Tab.close(_128);
}
GE.readOperating=false;
GE.isLetterDbClick=false;
return true;
}
return false;
}
function fReadMakeDate(d){
if(d==null){
return "";
}
var now=new Date();
var t=Math.abs(Math.floor((now.getTime()-d.getTime())/60000));
var rt="";
if(t>=(24*60)){
rt=Math.floor(t/(24*60))+gLang.read["day"];
}else{
if(t>=60){
rt=Math.floor(t/(60))+gLang.read["hour"];
}else{
if(t){
rt=t+gLang.read["minute"];
}
}
}
if(rt){
rt+=(d<now)?gLang.read["before"]:gLang.read["after"];
}else{
rt=gLang.read.page["date_justnow"];
}
return "<span title='"+rt+"'>"+gLang.date.formatFullDate(d)+" "+d.formatTime()+"</span>";
}
function fGetInviteHtml(dat,_130){
return "";
}
function fSetGroupMail(s){
try{
var str=s.trim();
var arr=str.split(",");
for(var i in arr){
arr[i]=fSetFromFormat(arr[i]);
}
return arr.join(", ");
}
catch(exp){
return s;
}
}
function fSetFromFormat(s){
try{
var str=s.trim();
if(str.indexOf("\"\"")==0){
str=str.replace(/.+&lt;/,"");
str=str.replace("&gt;","");
}
return str;
}
catch(exp){
return s;
}
}
function fGetPartRcpts(type,_138){
var s=CM["letter"][_138].data[type];
var str=s.trim();
var arr=str.split(",");
var arr1=[];
var len=arr.length;
var _13e=5;
var ls=[];
try{
for(var i=0;i<len;i++){
if(i==_13e){
arr1[arr1.length]="...";
ls[ls.length]="this.parentNode.style.display='none';this.parentNode.parentNode.lastChild.style.display=''";
ls[ls.length]=String.format(gLang.read.page.stillcontacts,len-_13e);
break;
}
arr1[arr1.length]=fSetFromFormat(arr[i]);
}
return "<div>"+fContentLink({content:arr1.join(", "),links:ls})+"</div>";
}
catch(exp){
return s;
}
}
function fGetAllRcpts(type,_142){
var s=CM["letter"][_142].data[type];
var str=s.trim();
var arr=str.split(",");
var arr1=[];
var len=arr.length;
var ls=[];
try{
for(var i=0;i<len;i++){
arr1[arr1.length]=fSetFromFormat(arr[i]);
}
ls[ls.length]="this.parentNode.style.display='none';this.parentNode.parentNode.firstChild.style.display=''";
ls[ls.length]=gLang.read.page.hidemsg;
return "<div style=\"display:none\">"+fContentLink({content:arr1.join(", "),links:ls})+"</div>";
}
catch(exp){
return s;
}
}
function getAttachLink(_14a,i,_14c){
return "<a href=\""+_14a[i].down+"\" class=\"fgn\" onclick=\"this.oncontextmenu(event)\" oncontextmenu=\"fSaveObj(this,event);fGoto('MM.read.attachOption',"+i+",'"+_14c+"',this.href);return false;\" onmouseout=\"\">"+"<b class=\"attachmentIcon tableIcon btnS\"> &nbsp;&nbsp; </b>"+_14a[i].name+"</a> ";
}
function fGetPartAttaches(_14d,_14e){
var _14f=CM["letter"][_14d].data.attach;
var arr1=[];
var len=_14f.length;
var _152=3;
var ls=[];
try{
for(var i=0;i<len;i++){
if(i==_152){
arr1[arr1.length]="...";
ls[ls.length]="this.parentNode.style.display='none';this.parentNode.parentNode.firstChild.nextSibling.style.display=''";
ls[ls.length]=gLang.read.page.showatta;
break;
}
arr1[arr1.length]=getAttachLink(_14f,i,_14e);
}
return "<div class=\"fLeft\">"+fContentLink({content:arr1.join(""),links:ls})+"</div>";
}
catch(exp){
return s;
}
}
function fGetAllAttaches(_155,_156){
var _157=CM["letter"][_155].data.attach;
var arr1=[];
var len=_157.length;
var _15a=3;
var ls=[];
try{
for(var i=0;i<len;i++){
arr1[arr1.length]=getAttachLink(_157,i,_156);
}
ls[ls.length]="this.parentNode.style.display='none';this.parentNode.parentNode.firstChild.style.display=''";
ls[ls.length]=gLang.read.page.hideatta;
return "<div class=\"fLeft\" style=\"display:none\">"+fContentLink({content:arr1.join(""),links:ls})+"</div>";
}
catch(exp){
return s;
}
}
function fPackAttaches(_15d){
var data=CM["letter"][_15d].data;
return "<div class=\"fLeft\"><a class=\"fgn\" href=\""+data.packAllAtta+"\" >"+gLang.read.page.packatta+"</a></div>";
}
function fContentLink(o){
var str=[o.content];
var _161=o.links;
for(var i=0;i<_161.length;i+=2){
var func=_161[i];
var hint=_161[i+1];
str[str.length]="<span onclick=\""+func+";return false\" class=\"mouseHand fgn\">"+hint+"</span>";
}
return str.join("");
}
function fRead_setReplyContent(_165,flag,from){
MM.execute("compose",fRead_setReplyContentImp.bind(this,_165,flag,from));
}
function fRead_setReplyContentImp(_168,flag,from){
if(_168=="draft"){
if(flag&&flag.indexOf("reply")==0){
UI.alert(gLang.read.msg.msg_replydraft);
}else{
if(flag&&flag.indexOf("forward")==0){
UI.alert(gLang.read.msg.msg_forwarddraft);
}
}
if(flag&&flag.indexOf("sendagain")!=0){
return;
}
}
var mod=null;
var _16c="";
if(from=="folder"){
var arr=MM[GE.currentFolder].dg.HTML.getSelectTargetArray();
if(arr.length>1){
if(flag.startsWith("forward")){
for(var i=0;i<arr.length;++i){
if(i){
_16c+=",";
}
_16c+=arr[i].chkValue;
}
flag="forward_a";
}else{
return;
}
}
if(!_168){
mod=false;
}else{
mod=MM[_168].readData;
}
}else{
mod=CM["letter"][_168];
}
if(!mod||MM["read"].isDeleted(_168)){
return;
}
if(flag=="forward_t"){
var _16f=CMXMail.selectForwardUserList(mod);
return;
}else{
if(flag=="reply"||flag=="replyall"){
GE.composeType="reply";
}else{
GE.composeType=flag;
}
}
var _170=MM["read"].midReplyMapping[mod.mid+"_"+flag];
if(_170&&UI.Tab.exist(_170)&&GE.composeType=="reply"){
MM.getModule(_170);
return;
}
MM.getModule("compose");
var _171=MM["compose"].index;
var _172="compose"+_171;
if(GE.composeType=="reply"){
MM["read"].midReplyMapping[mod.postmid+"_"+flag]="compose"+_171;
MM[_172].rp_data=mod.data;
var sURL="f:CMXMail.beginReplyEmail(\""+mod.data.mid+"\","+(flag=="replyall")+")";
MM[_172].cmURL=sURL;
CM.setCMReffer(_172);
}else{
if(flag=="forward"||flag=="forward_a"){
MM["read"].midForwardMapping[mod.postmid]="compose"+_171;
var _174="quote";
if(flag=="forward_a"){
_174="attach";
}else{
MM[_172].fw_data=mod.data;
}
GE.composeType="forward";
var sURL="f:CMXMail.beginForwardEmail(\""+(_16c?_16c:mod.data.mid)+"\",\""+_174+"\")";
MM[_172].cmURL=sURL;
CM.setCMReffer(_172);
}else{
if(flag=="sendagain"){
MM["read"].midSendAgainMapping[mod.postmid]="compose"+_171;
MM[_172].sa_data=mod.data;
var mid=mod.data.mid?mod.data.mid:mod.data.mail.mid;
var _176=mod.data.part?mod.data.part.id:-1;
var sURL="f:CMXMail.beginSendAgainEmail(\""+mid+"\",\""+_176+"\")";
MM[_172].cmURL=sURL;
CM.setCMReffer(_172);
}
}
}
if(from!="folder"){
UI.Tab.replace(_168,_172);
}
}
function fRead_attachOption(_177,_178,sUrl){
var f=$win();
var t=GE.getThis();
var ev=GE.getEvent();
var data=fReadPeekData(GE.laterRequestModule);
var part=data.getPart(_177);
var menu=[{width:"120",top:Event.pointerY(ev),left:Event.pointerX(ev)},[gLang.read.page.openatt,function(){
var url=sUrl.replace("&mode=download","&mode=inline");
if(part.isImage()){
UI.Dialog.openImage(gLang.read.page["attach_wintitle"]+part.info.filename,url);
}else{
if(part.isNested()){
part.readNested();
}else{
window.open(url,"_blank");
}
}
}],[gLang.read.page.downloadatt,fURLReffer.bind(null,sUrl,_178)]];
if(CC.User.supportNetfolder){
menu.add([gLang.read.page.attrsave2netfolder,fRead_saveToNetfolder.bind(null,_177)]);
}
Event.stop(ev);
if(ev.type=="click"){
menu[1][1]();
}else{
CMenu.create(menu);
}
}
function fRead_saveToNetFolderSetFid(fid){
var _182="lnks2nf"+fid;
if($(_182)){
UI.TreeView.setActive(_182);
}
$("nfSelFolderID").value=fid;
}
function fClickOkOfTopDialog(){
if(UI.Dialog.top()){
UI.Dialog.top().ok();
}
}
function fRead_saveToNetfolder(_183){
var data=fReadPeekData(GE.laterRequestModule);
var mid=data.getMid();
var part=data.getPart(_183).info.id;
function funGetHtml(){
var _187=518;
var _188="<div style=\"height:100%;width:"+_187+"\">"+"<form id=\"iaddressForm\" target=\"submitFrame\">"+"<div id=\"iaddressContentDiv\" class=\"addressMainDiv border1 bgcolor0\" style=\"height:406px;\">"+"<div id=\"nfFolder\" class=\"gFdlst\" style=\"height:400px;\"></div><br>"+"<input id=\"nfSelFolderID\" type=\"hidden\" value=\"\" style=\"display:none\">"+"</div></form></div>";
return _188;
}
function f(){
var root=CM.NF.getRoot();
new UI.Dialog({title:gLang.read.page.attrsave2netfolder,body:funGetHtml(),init:function(){
function getIcon(id){
switch(id){
case 10:
return "icoDOC";
case 11:
return "icoPIC";
case 12:
return "icoMUS";
}
return "icoFDR";
}
var ui=new UI.TreeView("nfFolder",{getRoot:(function(){
return {icon:"icoNFD",name:gLang.GLOBAL.mod.netfolder,link:{id:"lnks2nf"+root.id,functionName:"fRead_saveToNetFolderSetFid",args:[root.id],dblclick:"fClickOkOfTopDialog"},children:root.children};
}).bind(this),getNode:function(fi){
return {id:fi.id,icon:getIcon(fi.id),name:fi.name,link:{id:"lnks2nf"+fi.id,functionName:"fRead_saveToNetFolderSetFid",args:[fi.id],dblclick:"fClickOkOfTopDialog"},children:fi.children};
},resolveIdFromLink:function(_18d){
return _18d.replace("lnks2nf","");
}});
ui.render();
fRead_saveToNetFolderSetFid(root.id);
},action:function(_18e){
var fid=$("nfSelFolderID").value;
if(fid==""){
UI.alert(gLang.read.page["select_folder"]);
return false;
}else{
new CMXClient().simpleCall("mbox:saveMessageToNF",{id:mid,parts:[part],fid:fid-0},function(){
UI.alert(gLang.read.page["save2nfsuccess"]);
});
}
}});
}
MM.execute("nf",function(){
CM.NF.execute(f);
});
}
MM["welcome"].getHtml=fWelcomeGetHtml;
MM["welcome"].init=fWelcomeInit;
MM["welcome"].getNamePad=function(){
return String.format(gLang.GLOBAL["tab_letterUnit"],CM.MBOX.getTotalCount());
};
function fWelcomeGetHtml(){
var html="<div class=\"border2\" style=\"overflow:auto;overflow-x:hidden;height:"+GE.leftHeight+"px;\">";
var _191=sizeM(CM.MBOX.getQuotaSize(),"#");
var used=CM.MBOX.getUsedPercent();
var Fs=[];
CM.MBOX.forEachFolder(function(fi){
var _195=CC.getModuleByFid(fi.id,fi.name);
Fs.push({mdname:_195,fullPath:fi.getPathHTML(),unreadCnt:fi.stats.unreadMessageCount,msgCnt:fi.stats.messageCount,msgSize:sizeAuto(fi.stats.messageSize),usedPercent:fi.getPercent(),opts:fGenerateOptions(fi,_195)});
});
html+=this.getTemplate("tmpWelcome",{Folders:Fs,wel_hour:fHour(),wel_unreademail:String.format(gLang.welcome.page.unreadmail,CM.MBOX.getNewCount()).replace(/<a>/,"<a href=\"javascript:fGoto()\" onclick=fGoto(\"fGetUnread\")>"),wel_folderUnread:fGetFolder(),wel_r1:gLang.welcome.page["used_bar"].replace("%a",_191).replace("%u",used),wel_used_total:gLang.welcome.page["used_total"].replace("%",sizeM(CM.MBOX.getUsedSize())),wel_used_rest:gLang.welcome.page["used_rest"].replace("%",sizeM(CM.MBOX.getFreeSize()))});
html+="</div>";
return html;
function fGenerateOptions(fi,_197){
var html="";
act(fi.canEmpty()&&gLang.folder.action.empty,"MBOX_emptyFolder",fi.wasEmpty());
act(fi.canDelete()&&gLang.folder.action.del,"MBOX_deleteFolder",!fi.wasEmpty(true));
act(fi.canRename()&&gLang.folder.action.rename,"MBOX_renameFolder");
function act(text,func,_19b){
html+="<div class=\"fLeft wid1\">";
if(text){
if(_19b||!func){
html+="<a style=\"color:#BBB\">"+text+"</a>";
}else{
html+="<a href=\"javascript:fGoto();\" class=\"fgn\" onclick=\"fGoto('"+func+"',"+fi.id+")\">"+text+"</a>";
}
}
html+="</div>";
}
return html;
}
function fGetFolder(){
var html="",j=0;
CM.MBOX.forEachFolder(function(fi){
if(fi.stats.unreadMessageCount>0){
var mod=fGetModuleByFid(fi.id,fi.name);
if(j++>0){
html+=", ";
}
html+="<a href=\"javascript:fGoto()\" onclick=fGoto(\"MM.execute\",\""+mod+"\")>"+fi.name.left(10).escapeHTML()+"(<span class=\"wel_num\">"+fi.stats.unreadMessageCount+"</span>)</a>";
}
});
if(j){
html+="&nbsp;";
}
return html;
}
function fHour(){
var d=new Date();
var h=d.getHours();
var m=d.getMinutes();
if(0<=h&&h<5){
return gLang.welcome.page["midnight"];
}
if((5<=h&&h<10)||(h==10&&m<30)){
return gLang.welcome.page["morning"];
}
if((10==h&&m>=30)||(11<=h&&h<13)||(h==13&&m<30)){
return gLang.welcome.page["noon"];
}
if((13==h&&m>=30)||(14<=h&&h<18)){
return gLang.welcome.page["afternoon"];
}
return gLang.welcome.page["night"];
}
}
function fWelcomeInit(){
var t=$("aWelmail");
if(t){
t.onclick=function(){
fGoCompose({to:this.innerHTML});
return false;
};
}
var bar=$("wel_percentBar");
if(bar){
bar.style.styleFloat="right";
bar.parentNode.removeChild(bar);
$("WelPages").appendChild(bar);
}
$("welBulletin").style.width="0%";
$("welBrief").style.width="100%";
var free="-"+Math.round(CM.MBOX.getFreeRatio()*244)+"px";
Template.fill({},[],[["wel_r1","backgroundPosition",free+" -99px"],["bulletin","display","none"]]);
if(CM.OrgInfo.options.bulletin){
function fillBulletin(){
bar=$("wel_percentBar");
var _1a5=CM.OrgInfo.bulletin;
if(_1a5){
var obj=CM.OrgInfo.bulletin;
Template.fill({"bulletin_org_name":""+CM.OrgInfo.name.escapeHTML(),"bulletin_date":obj["date"].formatDateTime(),"bulletin_subject":""+obj["subject"].escapeHTML(),"bulletin_content":obj["text"]?obj["text"].escapeHTML():(obj["html"]?obj["html"]:"")},[],[["bulletin","display","block"]]);
if(bar){
bar.style.styleFloat="left";
bar.parentNode.removeChild(bar);
$("wel_right_div").appendChild(bar);
}
$("welBulletin").style.width="55%";
$("welBrief").style.width="45%";
}else{
}
}
if(CM.OrgInfo.bulletin==null){
new CMXClient().simpleCall("org:getBulletin",null,function(obj){
CM.OrgInfo.bulletin=obj;
fillBulletin();
});
}else{
fillBulletin();
}
}
}
function fGetUnread(){
var cond={field:"flags",operator:"contains",operand:{read:false}};
CM.searchByCondition(cond);
}
function fGoInbox(){
MBOX_reload();
MM["inbox"].load=false;
MM.execute("inbox");
}
function fIsMe(_1a9){
return GE.UID==EmailAddress.parseSingleEmail(_1a9);
}
function fGetHelp(type){
function callback(){
if(type=="shortcut"){
$("shortcutHelpLink").onclick();
}
}
fGetOption("optHelp",callback);
}
function fGetOption(_1ab,_1ac){
if(_1ab){
MM["option"].optId=_1ab;
}
MM.execute("option",function(){
MM.getModule("option");
if(_1ac){
_1ac();
}
});
}
function fSetNeedCheckBeforeLeave(_1ad){
MM.noNeedCheck=!_1ad;
}
function fNeedCheckBeforeLeave(){
return !MM.noNeedCheck;
}
function fLeaveCheck(_1ae){
return !_1ae||(fComposeAllEmpty()?_1ae():UI.confirm({message:gLang.GLOBAL.msg_exist_compose_mail,no:_1ae}));
}

function LetterPaper(){
}
LetterPaper.update=fStationery;
LetterPaper.control=fGetStationeryHTML;
LetterPaper.goPage=fGoPageByPageNo;
LetterPaper.setPage=fGoPage;
LetterPaper.set=fComposeSetPaper;
LetterPaper.hideAutoAddress=f_SetDivDisplay;
LetterPaper.curPage=[];
LetterPaper.curWin=[];
function fStationery(_1,_2){
var _3=MM["compose"+_2];
if(_1>=0){
var _4=new RegExp("<span id=\"*spnEditorSign\"*>.*?</span>","ig");
if(!_4.test(_3.getEditor())){
_3.setEditor(_3.getEditor()+"<span id=\"spnEditorSign\"></span>");
}
}
Stationery.applyDocument(_1,_3.getEditorDoc());
if(_1>=0){
Stationery.setLineHeight(GE.fontsize,_3.getEditorDoc());
}
}
function fGetStationeryHTML(_5,_6){
var id=_5.name.replace("ifrComposeEditor","");
if(_6=="hide"){
if(document.all&&gVersion<=5.01){
}else{
LetterPaper.set("hide",id);
}
return;
}
var _8=MM["compose"+id];
var _9=MM["compose"].selStationery;
if(!_9){
function option(_a,_b){
return {value:_a,text:_b};
}
var _c=Stationery.names;
var _d=[];
for(var i=0;i<_c.length;++i){
_d[i]=option(i,_c[i]);
}
_9={options:_d};
_9.length=_9.options.length;
MM["compose"].selStationery=_9;
}
var _f=_8.div;
if(typeof LetterPaper.curPage[id]=="undefined"||(document.all&&gVersion<=5.01)){
LetterPaper.curPage[id]=0;
}
var _10=2;
var _11=4;
var _12=_10*_11;
var l=0,n=0,m=0;
var x=0,y=0;
var len=_9.length;
var _16="";
l=Math.ceil(len/_12);
x=len%_12;
function fGetEachPage(){
var s="<span id='spnEachPage"+id+"'>&nbsp;";
for(var i=0;i<l;i++){
s+="<a href=\"javascript:void(0)\" onclick=fGoto0(\"LetterPaper.goPage\","+i+","+l+",\""+id+"\")>";
if(i){
s+=(i+1);
}else{
s+="<font color='#ff0000'>"+(i+1)+"</font>";
}
s+="</a>&nbsp;";
}
s+="</span>";
return s;
}
var div;
var _1a="divComposeStationeryPreview"+id;
div=$(_1a);
if(div){
El.show(div);
return;
}
_16+="<table class=\"lpArea\" width=\"460\" height=\"160\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#333333\">"+" <tr bgcolor=\"#e7e7e7\">"+" <td height=\"21px;\" style=\"font-size:12px\">"+"       <ul>"+"     <li style=\"float:left; \">"+gLang.compose.stationery["beautiful_stationery"]+"&nbsp;&nbsp;<a href=\"javascript:void(0)\" onclick=fGoto0(\"LetterPaper.set\",\"clear\",\""+id+"\")>"+gLang.compose.stationery["cancel"]+"</a></li>"+"     <li style=\"float:left;margin-left:90px !important;margin-left:113px;margin-bottom:5px;\">"+"               <span style=\"visibility:hidden;font-size:12px;\" id=\"spnPre"+id+"\" >"+"                 <input type=\"hidden\" value=\"0\" style=\"display:none\">"+"                 <a href=\"javascript:void(0)\" onclick=\"fGoto0('LetterPaper.setPage','0','"+l+"','"+id+"');return false\">"+gLang.compose.stationery["previous_page"]+"</a>"+"               </span>"+"             </li>";
_16+="             <li style=\"float:left;margin-left:8px;\">"+fGetEachPage()+"             </li>";
_16+="     <li style=\"float:left;margin-left:8px;\">"+"               <span id=\"spnNext"+id+"\" style=\"font-size:12px;\">"+"                 <input type=\"hidden\" value=\"1\" style=\"display:none\">"+"                 <a href=\"javascript:void(0)\" onclick=\"fGoto0('LetterPaper.setPage','1','"+l+"','"+id+"');return false\">"+gLang.compose.stationery["next_page"]+"</a>"+"               </span>"+"             </li>"+"             <li style=\"float:right; margin-right:3px\">"+"               <a class=\"btnS btnClose hideie5\" href=\"javascript:void(0)\" onclick=fGoto0(\"LetterPaper.set\",\"hide\",\""+id+"\")></a>"+"             </li>"+"       </ul>"+"     </td>"+"  </tr>"+"  <tr bgcolor=\"#ffffff\">"+"    <td>"+"      <span id=\"tbList"+id+"\">";
for(var i=0;i<l;i++){
if(i==l-1&&x>0){
n=Math.floor(x/_11)+1;
y=x;
}else{
n=_10;
y=_11;
}
if(y>0){
_16+="<table width=\"100%\" height=\"165\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" style=\" font-size:12px;display:none\">";
for(var j=0;j<n;j++){
if(j==n-1&&i==l-1&&x>0){
m=y;
}else{
m=_11;
}
if(m>0){
_16+="<tr bgcolor=\"F8F8F8\">";
for(var k=0;k<m;k++){
var iNo=(i*_12+j*_11+k);
try{
_16+="<td style=\"font-size:12px;\"><div align=\"center\"><A href=\"javascript:void(0)\" onclick=fGoto0(\"LetterPaper.set\",\""+_9.options[iNo].value+"\",\""+id+"\")><img src=\""+Stationery.getThumbnail(iNo)+"\" width=\"78\" height=\"48\" style=\"border:1px #cccccc solid;;margin-bottom:3px\"></a><br>["+_9.options[iNo].text+"]</div></td>";
}
catch(ex){
}
}
_16+="</TR>";
}
}
_16+="</TABLE>";
}
}
_16+="</span></td></tr>"+"</table>";
div=El.createElement("div");
div.id=_1a;
div.border="1px #cccccc solid";
div.style.position="absolute";
div.style.backgroundColor="#cccccc";
div.style.zIndex=999;
div.innerHTML=_16;
div.onclick=function(e){
Event.stop(e?e:$win().event);
};
fSetDragAble(div);
var _1f,iTop;
var _20=window.screen.width;
if(_20>=1024){
_1f=360;
iTop=290;
}else{
_1f=265;
iTop=192;
}
div.style.left=_1f+"px";
div.style.top=iTop+"px";
_f.appendChild(div);
var _21=$("tbList"+id);
_21.childNodes[0].style.display="";
}
function fGoPageByPageNo(_22,_23,sId){
var $$;
if(document.all&&gVersion<=5.01){
$$=function(t){
return LetterPaper.curWin[sId].document.getElementById(t);
};
}else{
$$=$;
}
LetterPaper.curPage[sId]=_22;
var _27=$$("tbList"+sId);
var _28=$$("spnPre"+sId);
var _29=$$("spnNext"+sId);
var _2a=$$("spnEachPage"+sId).getElementsByTagName("A");
for(var i=0;i<_27.childNodes.length;i++){
if(_27.childNodes[i].tagName=="TABLE"){
_27.childNodes[i].style.display="none";
}
}
_27.childNodes[_22].style.display="";
for(var i=0;i<_2a.length;i++){
_2a[i].innerHTML=i+1;
}
_2a[_22].innerHTML="<font color='#ff0000'>"+(_22+1)+"</font>";
if(_22==0){
_28.style.visibility="hidden";
_29.style.visibility="visible";
_28.childNodes[0].value="0";
_29.childNodes[0].value="1";
}else{
if(_22==_23-1){
_28.style.visibility="visible";
_29.style.visibility="hidden";
_28.childNodes[0].value=_23-2;
_29.childNodes[0].value=_23-1;
}else{
_28.style.visibility="visible";
_29.style.visibility="visible";
_28.childNodes[0].value=_22-1;
_29.childNodes[0].value=_22+1;
}
}
}
function fGoPage(_2c,_2d,sId){
var _2f=LetterPaper.curPage[sId];
if(_2c==0){
_2f--;
}else{
_2f++;
}
LetterPaper.goPage(_2f,_2d,sId);
}
function fComposeSetPaper(_30,sId){
switch(_30){
case "clear":
_30=-1;
break;
case "hide":
var _32=$("divComposeStationeryPreview"+sId);
if(_32){
El.hide(_32);
}
return;
}
LetterPaper.update(_30,sId);
}
function fSetWindowEvent(){
var win=window.parent.frames["indexFrame"];
if(win&&win.document&&win.document.body){
win.document.onkeypress=function(e){
return !fShortCut(e,"indexFrame",false);
};
win.document.onkeydown=function(e){
return !fShortCut(e,"indexFrame",true);
};
}else{
window.setTimeout(fSetWindowEvent,1000);
}
}
fSetWindowEvent();
function fShortCut(e,_37,_38){
var win=window.parent.frames[_37];
var _3a=GE.laterRequestModule;
if(!_3a){
return false;
}
var ev,key,target;
if(!GE.IsIE){
ev=e;
key=ev.charCode;
target=ev.target;
}else{
ev=win.event;
key=ev.keyCode;
target=ev.srcElement;
}
var tag=target.tagName.toUpperCase();
var _3d=((tag=="INPUT"||tag=="TEXTAREA")&&(target.type!="button"));
var _3e=ev.shiftKey;
var _3f=ev.ctrlKey;
var _40=ev.altKey;
var _41=_3a.indexOf("compose")>-1;
var _42=_3a.indexOf("letter")>-1||MM[_3a].isFolder;
var _43=MM[_3a].isFolder;
var _44=_3a.indexOf("letter")>-1;
var _45=(ev.keyCode==13);
var _46=(ev.keyCode==27);
var _47,k_closeTab,k_newCompose,k_newContact;
var _48,k_replyall,k_forward,k_markread;
var _49,k_pretab,k_nexttab,k_enteraddress,k_savedraft,k_send,k_selall;
if(_38){
k_savedraft=(ev.keyCode==83)&&_3f&&_41;
k_send=GE.IsIE&&(ev.keyCode==13)&&_3f&&_41;
k_selall=GE.IsIE&&(ev.keyCode==65)&&_3f&&!_42&&!_41;
}else{
_47=(key==109)&&!_3f;
k_closeTab=_3f&&(key==28||key==92);
k_newCompose=(key==110)&&!_3f;
k_newContact=(key==99)&&!_3f;
_48=(key==114)&&_42&&!_3f;
k_replyall=(key==97)&&_42&&!_3f;
k_forward=(key==102)&&_42&&!_3f;
k_markread=(key==107)&&_42&&!_3f;
_49=(key==112)&&!_3f;
k_pretab=(key==44);
k_nexttab=(key==46);
k_enteraddress=(_45&&_3a=="address");
k_send=!GE.IsIE&&_3f&&_41&&ev.keyCode==13;
k_selall=!GE.IsIE&&key==97&&!_42&&_3f;
}
var _4a=UI.Dialog.top();
if(_4a){
if(_45){
if(tag!="TEXTAREA"){
_4a.ok();
return true;
}
}else{
if(_46){
_4a.cancel();
return true;
}
}
return false;
}
if(_3d&&!k_send&&!k_savedraft&&!k_closeTab){
return false;
}
if(_47){
CC.getNewMailCount();
return true;
}else{
if(k_closeTab){
UI.Tab.close(_3a);
return true;
}else{
if(k_newCompose){
fGoCompose();
return true;
}else{
if(k_newContact){
CMXMail.addUserAddress("","");
return true;
}else{
if(_48){
if(_43){
MM.read.setReplyContent(_3a,"reply","folder");
}else{
MM.read.setReplyContent(_3a,"reply","read");
}
return true;
}else{
if(k_replyall){
if(_43){
MM.read.setReplyContent(_3a,"replyall","folder");
}else{
MM.read.setReplyContent(_3a,"replyall","read");
}
return true;
}else{
if(k_forward){
if(_43){
MM.read.setReplyContent(_3a,"forward","folder");
}else{
MM.read.setReplyContent(_3a,"forward","read");
}
}else{
if(k_markread){
MM[_3a].folderHandle("toggleread");
return true;
}else{
if(k_send){
Event.stop(ev);
MM[_3a].control("send");
return true;
}else{
if(k_savedraft){
Event.stop(ev);
MM[_3a].control("save");
return true;
}else{
if(_49){
if(_42){
fFolder_printPage(_3a);
}else{
window.print();
}
return true;
}else{
if(k_pretab){
var tab=UI.Tab.exist(_3a);
var pre=El.preSibling(tab);
if(pre&&pre.tagName.toUpperCase()=="TABLE"){
pre.onclick();
}
return true;
}else{
if(k_nexttab){
var tab=UI.Tab.exist(_3a);
var _4d=El.nextSibling(tab);
if(_4d&&_4d.tagName.toUpperCase()=="TABLE"){
_4d.onclick();
}
return true;
}else{
if(k_enteraddress){
return true;
}else{
if(k_selall){
if(_3a=="address"||_3a=="orgaddr"){
AddressGUI.selectAll(_3a,true);
Event.stop(ev);
return true;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return false;
}
window.onbeforeunload=function(){
if(fNeedCheckBeforeLeave()&&!fComposeAllEmpty()){
return gLang.compose.msg["qry_lostdata"];
}
};
window.onunload=function(){
var _4e="compose";
if(MM[_4e]&&MM[_4e].cancelAll){
MM[_4e].cancelAll();
}
};
function AutoAddress(){
this.init=faa_Init;
this.create=faa_Create;
this.ns=["globe","data","input","list"];
this.newNs=faa_NewNs;
this.regNs=faa_RegNs;
this.newNs(this.ns);
this.init();
}
function faa_Init(){
this.regNs("globe");
this.globe.win=$win();
this.globe.doc=this.globe.win.document;
this.globe.ev=null;
this.globe.IsIE=document.all;
this.globe.getEv=faa_GetEv;
this.globe.focus=faa_Focus;
this.globe.remove=faa_Remove;
this.globe.getTarget=faa_GetTarget;
this.regNs("data");
this.data.value=null;
this.data.oab=[];
this.data.set=faa_SetData;
this.data.get=faa_GetData;
this.data.getCurrentData=faa_GetCurrentData;
this.data.selectedObj=null;
this.regNs("input");
this.input.element=null;
this.input.currentMatch="";
this.input.set=faa_SetInput;
this.input.setKeyUpEvent=faa_SetKeyUpEvent;
this.input.setKeyDownEvent=faa_SetKeyDownEvent;
this.input.setBlurEvent=faa_SetBlurEvent;
this.input.setMouseOverEvent=faa_SetMouseOverEvent;
this.input.setEvent=faa_SetEvent;
this.input.fill=faa_Fill;
this.regNs("list");
this.list.element=null;
this.list.create=faa_ListCreate;
this.list.addItem=faa_AddItem;
this.list.getObjByIndex=faa_GetObjByIndex;
this.list.setClickEvent=faa_SetClickEvent;
this.list.strongKeyWord=faa_StrongKeyWord;
}
function faa_RegNs(ns){
var obj=this[ns];
obj.parent=this;
for(var i=0;i<this.ns.length;i++){
obj[this.ns[i]]=this[this.ns[i]];
}
return obj;
}
function faa_NewNs(){
var ns=this.ns;
for(var i=0;i<ns.length;i++){
this[ns[i]]=new Object();
}
}
function faa_Create(_54,_55,id){
this.data.set(_54);
this.input.set(_55);
this.list.id=id;
}
function faa_GetTarget(){
var o=null;
if(this.ev.target){
o=this.ev.target;
}else{
o=this.ev.srcElement;
}
return o;
}
function faa_Remove(){
var el=this.list.element;
if(el){
try{
el.parentNode.removeChild(el);
}
catch(exp){
try{
el.removeNode(true);
}
catch(exp){
el.style.display="none";
el.id="";
}
}
this.data.selectedObj=null;
el=null;
}
}
function faa_SetData(arr){
this.data.value=arr;
}
function faa_GetData(){
return this.data.value;
}
function faa_Focus(obj){
if(this.data.selectedObj){
this.data.selectedObj.className="";
}
this.data.selectedObj=obj;
this.data.selectedObj.className=g_TdCssClassName;
}
function faa_GetObjByIndex(_5b){
var tb=this.element.firstChild;
if(_5b<0||_5b>tb.rows.length-1){
return null;
}
return tb.rows[_5b].cells[0];
}
function faa_SetInput(_5d){
if(_5d.length||_5d.length==0){
for(var i=0;i<_5d.length;i++){
this.setEvent(_5d[i]);
}
}else{
this.setEvent(_5d);
}
}
function faa_SetEvent(o){
if(typeof (o)=="STRING"){
o=$(o);
}
this.element=o;
this.element.onkeyup=this.setKeyUpEvent;
this.element.onkeydown=this.setKeyDownEvent;
var ns=this.parent.ns;
for(var i=0;i<ns.length;i++){
this.element[ns[i]]=this[ns[i]];
}
}
function faa_SetClickEvent(e){
var ev=e||$win().event;
Event.stop(ev);
this.input.fill();
this.globe.remove();
}
function faa_SetKeyUpEvent(ev){
ev=this.globe.getEv(ev);
var el=this.list.element;
var _66=this.globe.getTarget();
this.input.element=_66;
this.input.currentMatch="";
var kc=ev.keyCode;
var _68=false;
switch(kc){
case 13:
this.input.fill();
this.globe.remove();
_68=true;
break;
case 27:
case 9:
this.globe.remove();
_68=true;
break;
case 8:
if(_66.value==""){
this.globe.remove();
}
break;
case 38:
_68=true;
break;
case 40:
_68=true;
break;
default:
break;
}
if(!_68&&this.input.element.value!=""){
if(this.task!=null){
clearTimeout(this.task);
}
var _69=this.list;
this.task=setTimeout(function(){
_69.create();
},GE.keyUpSearchDelay);
}else{
return false;
}
return true;
}
function faa_SetKeyDownEvent(ev){
ev=this.globe.getEv(ev);
var kc=ev.keyCode;
if(kc==9){
this.globe.remove();
}
if(window.gTemp){
return;
}
gTemp=true;
window.setTimeout("gTemp=false;",50);
if(kc==13){
return true;
}
if(this.list.element&&this.list.element.style.display!="none"){
if(!this.data.selectedObj){
return;
}
switch(kc){
case 38:
var _6c=this.data.selectedObj.index;
var obj=this.list.getObjByIndex(_6c-1);
if(obj){
this.globe.focus(obj);
}
break;
case 40:
var _6c=this.data.selectedObj.index;
var obj=this.list.getObjByIndex(_6c+1);
if(obj){
this.globe.focus(obj);
}
break;
default:
break;
}
}
}
function faa_SetBlurEvent(ev){
ev=this.globe.getEv(ev);
var _6f=this.globe.getTarget();
var s=_6f.value;
var x=s.substr(s.length-1,1);
if(x==","||x==";"){
_6f.value=s.substr(0,s.length-1);
}
}
function faa_GetEv(ev){
this.ev=this.IsIE?this.win.event:ev;
return this.ev;
}
function faa_Fill(){
if(!this.list.element||this.list.element.style.display=="none"){
return;
}
var el=this.input.element;
var s=el.value.trim();
var i1=s.lastIndexOf(";");
var i2=s.lastIndexOf(",");
var l=i1>i2?i1:i2;
s=s.substring(0,l+1);
el.focus();
var o=this.data.selectedObj;
if(o){
el.value=s+"\""+o.name+"\" "+"<"+o.address+">,";
}
}
function faa_SetMouseOverEvent(ev){
ev=this.globe.getEv(ev);
var o=this.globe.getTarget();
while(o.tagName!="TD"){
o=o.parentNode;
}
o.className="";
if(this.data.selectedObj!=null){
this.data.selectedObj.className="";
}
this.data.selectedObj=o;
this.data.selectedObj.className=g_TdCssClassName;
}
function faa_AddItem(tb,_7c,_7d,_7e,_7f){
var row=tb.insertRow(-1);
var _81=row.insertCell(-1);
El.setAttr(_81,{"align":"left","className":((i==0)?g_TdCssClassName:"")});
El.setStyle(_81,{"cursor":this.globe.IsIE?"hand":"pointer"});
_81.onmouseover=this.input.setMouseOverEvent;
_81.name=(_7c==null)?"":_7c.replace(/\"/g,"").replace(/&quot;/g,"");
_81.address=_7d;
_81.ismatchNameOrAddr=_7e;
_81.idxmatch=_7f;
_81.index=tb.rows.length-1;
_81.onclick=this.setClickEvent;
_81.onmouseup=_81.onmousedown=function(e){
var ev=e||$win().event;
Event.stop(ev);
};
this.strongKeyWord(_81);
var ns=this.parent.ns;
for(var j=0;j<ns.length;j++){
_81[ns[j]]=this[ns[j]];
}
}
function faa_ListCreate(){
if(this.element){
this.globe.remove();
}
var div=El.createElement("DIV");
div.id="autoAddress"+this.id;
this.globe.doc.body.appendChild(div);
this.element=div;
var _87=this.input.element;
div.style.position="absolute";
El.setStyle(div,{"top":(El.getY(_87)+25)+"px","left":(El.getX(_87))+"px","zIndex":999});
var tb=El.createElement("TABLE");
tb.id="autoAddressTable";
El.setAttr(tb,{"border":0,"cellSpacing":2,"cellPadding":2,"className":g_TbCssClassName});
div.appendChild(tb);
var _89=Object.extend([],{idxMatch:[]});
var _8a=Object.extend([],{idxMatch:[]});
var _8b=Object.extend([],{idxMatch:[]});
var _8c=Object.extend([],{idxMatch:[]});
var _8d=this.data.getCurrentData();
var _8e=this;
if(_8d.constructor==Array){
if(CC.User.supportPAB){
function sortAndShowAutoAddressUI(){
var a=0;
var b=0;
var c=0;
var d=0;
var _93=0;
if(_8d.length>0){
_93=_8d.idxMatch.length;
}
for(var n=0;n<_93;n++){
if(_8d.idxMatch[n][0]==0&&_8d.idxMatch[n][1]==0){
_89[a]=_8d[n];
_89.idxMatch[a]=new Array(0,0);
a++;
}
if(_8d.idxMatch[n][0]==0&&_8d.idxMatch[n][1]!=0){
_8b[b]=_8d[n];
_8b.idxMatch[b]=new Array(0,_8d.idxMatch[n][1]);
b++;
}
if(_8d.idxMatch[n][0]==1&&_8d.idxMatch[n][1]==0){
_8a[c]=_8d[n];
_8a.idxMatch[c]=new Array(1,0);
c++;
}
if(_8d.idxMatch[n][0]==1&&_8d.idxMatch[n][1]!=0){
_8c[d]=_8d[n];
_8c.idxMatch[d]=new Array(1,_8d.idxMatch[n][1]);
d++;
}
}
for(var i=0;i<a;i++){
_8e.addItem(tb,_89[i].true_name,_89[i].email,_89.idxMatch[i][0],_89.idxMatch[i][1]);
}
for(var i=0;i<b;i++){
_8e.addItem(tb,_8b[i].true_name,_8b[i].email,_8b.idxMatch[i][0],_8b.idxMatch[i][1]);
}
for(var i=0;i<c;i++){
_8e.addItem(tb,_8a[i].true_name,_8a[i].email,_8a.idxMatch[i][0],_8a.idxMatch[i][1]);
}
for(var i=0;i<d;i++){
_8e.addItem(tb,_8c[i].true_name,_8c[i].email,_8c.idxMatch[i][0],_8c.idxMatch[i][1]);
}
}
function sortAndShowAutoAddressUI2(){
var _96;
if(_8d.length>20){
_96=20;
}else{
_96=_8d.length;
}
var j1=0;
var j2=0;
var j3=0;
var j4=0;
var _9b=0;
if(_8d.length>0){
_9b=_8d.idxMatch.length;
}
for(var n=0;n<_9b;n++){
if(_8d.idxMatch[n][0]==0&&_8d.idxMatch[n][1]==0){
_89[j1]=_8d[n];
_89.idxMatch[j1]=new Array(0,0);
j1++;
}
if(_8d.idxMatch[n][0]==0&&_8d.idxMatch[n][1]!=0){
_8b[j2]=_8d[n];
_8b.idxMatch[j2]=new Array(0,_8d.idxMatch[n][1]);
j2++;
}
if(_8d.idxMatch[n][0]==1&&_8d.idxMatch[n][1]==0){
_8a[j3]=_8d[n];
_8a.idxMatch[j3]=new Array(1,0);
j3++;
}
if(_8d.idxMatch[n][0]==1&&_8d.idxMatch[n][1]!=0){
_8c[j4]=_8d[n];
_8c.idxMatch[j4]=new Array(1,_8d.idxMatch[n][1]);
j4++;
}
}
for(var i=0;i<j1&&_96>0;i++){
_8e.addItem(tb,_89[i].true_name,_89[i].email,_89.idxMatch[i][0],_89.idxMatch[i][1]);
_96--;
}
for(var i=0;i<j2&&_96>0;i++){
_8e.addItem(tb,_8b[i].true_name,_8b[i].email,_8b.idxMatch[i][0],_8b.idxMatch[i][1]);
_96--;
}
for(var i=0;i<j3&&_96>0;i++){
_8e.addItem(tb,_8a[i].true_name,_8a[i].email,_8a.idxMatch[i][0],_8a.idxMatch[i][1]);
_96--;
}
for(var i=0;i<j4&&_96>0;i++){
_8e.addItem(tb,_8c[i].true_name,_8c[i].email,_8c.idxMatch[i][0],_8c.idxMatch[i][1]);
_96--;
}
}
if(CC.User.supportOAB&&(_8d.length<20)&&this.input.currentMatch.trim().length>0){
var _9e=this.input.currentMatch;
var _9f=false;
var _a0=this.data.oab;
function changeOabAryOrder(_a1){
var _a2=_a0[_a1];
for(;_a1>0;_a1--){
_a0[_a1]=_a0[_a1-1];
}
_a0[0]=_a2;
}
function addOabDataToCurrentData(_a3,_a4){
var j=_8d.length;
var _a6;
var _a7;
for(var i=0,len=_a4.length;i<len;i++){
var d=_a4[i];
if(!_8d.keys["\""+d.true_name+"\" <"+d.email+">"]){
_a6=PY.indexOf(d.true_name,_a3);
_a7=PY.indexOf(d.email,_a3);
if(_a6>-1){
_8d[j]=d;
_8d.keys["\""+d.true_name+"\" <"+d.email+">"]={};
_8d.idxMatch[j]=new Array(0,_a6);
j++;
}else{
if(_a7>-1){
_8d[j]=d;
_8d.keys["\""+d.true_name+"\" <"+d.email+">"]={};
_8d.idxMatch[j]=new Array(1,_a7);
j++;
}
}
}
if(j>19){
break;
}
}
}
var _aa=0;
var _ab=-1;
for(var i=0,len=_a0.length;i<len;i++){
var oab=_a0[i];
if(_9e.indexOf(oab.key)==0){
if(oab.key.length>_aa){
_aa=oab.key.length;
}
}
}
for(var i=0,len=_a0.length;i<len;i++){
var oab=_a0[i];
if(_9e.indexOf(oab.key)==0&&(oab.key==_9e.substr(0,_aa))){
_ab=oab.data.length;
changeOabAryOrder(i);
addOabDataToCurrentData(_9e,oab.data);
break;
}
}
if(_8d.length<20&&(_ab==-1||_ab>=200)){
function callBack(_ae){
if(_a0.length<10){
_a0.unshift({key:_9e,data:_ae});
}else{
_a0.pop();
_a0.unshift({key:_9e,data:_ae});
}
addOabDataToCurrentData(_9e,_ae);
var _af=_8d;
sortAndShowAutoAddressUI();
}
CMXMail.searchOrgAddressList(_9e,callBack,GE.addrFetchSize);
}else{
sortAndShowAutoAddressUI();
}
}else{
sortAndShowAutoAddressUI2();
}
}
}
if(tb.rows.length>0){
this.globe.focus(tb.rows[0].cells[0]);
}
}
function faa_StrongKeyWord(_b0){
var _b1=_b0.name;
var _b2=_b0.address;
var _b3=_b0.idxmatch;
var _b4=_b0.ismatchNameOrAddr;
var _b5=this.input.currentMatch.toLowerCase();
if(_b4==0){
_b1=_b1.substring(0,_b3)+"<b>"+_b1.substring(_b3,_b3+_b5.length).escapeHTML()+"</b>"+_b1.substring(_b3+_b5.length).escapeHTML();
}else{
_b1=_b1.escapeHTML();
}
if(_b4==1){
_b2=_b2.substring(0,_b3)+"<b>"+_b2.substring(_b3,_b3+_b5.length)+"</b>"+_b2.substring(_b3+_b5.length);
}
_b0.innerHTML="&quot;"+_b1+"&quot;&nbsp;&lt;"+_b2+"&gt;";
}
function faa_GetCurrentData(){
var s=this.input.element.value;
var k=s.length;
var n="";
var _b9=0;
if(s.lastIndexOf(",")>s.lastIndexOf(";")){
_b9=s.lastIndexOf(",");
}else{
_b9=s.lastIndexOf(";");
}
n=s.substring(_b9+1,k);
n=n.replace(/\n/g,"");
n=n.trim();
if(n==""){
return [];
}
this.input.currentMatch=n;
var arr=Object.extend([],{keys:{},idxMatch:[]});
var re;
var j=0;
try{
for(var i=0;i<this.data.value.length;i++){
var _be;
if((_be=(PY.indexOf(this.data.value[i][0],n)))>-1){
arr[j]={true_name:this.data.value[i][0],email:this.data.value[i][1]};
arr.keys["\""+this.data.value[i][0]+"\" <"+this.data.value[i][1]+">"]={};
arr.idxMatch[j]=new Array(0,_be);
j++;
}else{
if((_be=(PY.indexOf(this.data.value[i][1],n)))>-1){
arr[j]={true_name:this.data.value[i][0],email:this.data.value[i][1]};
arr.keys["\""+this.data.value[i][0]+"\" <"+this.data.value[i][1]+">"]={};
arr.idxMatch[j]=new Array(1,_be);
j++;
}
}
}
}
catch(ex){
}
return arr;
}
function f_SetDivDisplay(id){
var _c0=$("autoAddress"+id);
if(_c0){
_c0.style.display="none";
}
}

var PY={};
(function(){
var _1="YDYQSXMWZSSXJBYMGCCZQPSSQBY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PCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY";
var _2={"19969":"DZ","19975":"WM","19988":"QJ","20048":"YL","20056":"SC","20060":"NM","20094":"QG","20127":"QJ","20167":"QC","20193":"YG","20250":"KH","20256":"ZC","20282":"SC","20285":"QJG","20291":"TD","20314":"YD","20340":"NE","20375":"TD","20389":"YJ","20391":"CZ","20415":"PB","20446":"YS","20447":"SQ","20504":"TC","20608":"KG","20854":"QJ","20857":"ZC","20911":"PF","20504":"TC","20608":"KG","20854":"QJ","20857":"ZC","20911":"PF","20985":"AW","21032":"PB","21048":"XQ","21049":"SC","21089":"YS","21119":"JC","21242":"SB","21273":"SC","21305":"YP","21306":"QO","21330":"ZC","21333":"SDC","21345":"QK","21378":"CA","21397":"SC","21414":"XS","21442":"SC","21477":"JG","21480":"TD","21484":"ZS","21494":"YX","21505":"YX","21512":"HG","21523":"XH","21537":"PB","21542":"PF","21549":"KH","21571":"E","21574":"DA","21588":"TD","21589":"O","21618":"ZC","21621":"KHA","21632":"ZJ","21654":"KG","21679":"LKG","21683":"KH","21710":"A","21719":"YH","21734":"WOE","21769":"A","21780":"WN","21804":"XH","21834":"A","21899":"ZD","21903":"RN","21908":"WO","21939":"ZC","21956":"SA","21964":"YA","21970":"TD","22003":"A","22031":"JG","22040":"XS","22060":"ZC","22066":"ZC","22079":"MH","22129":"XJ","22179":"XA","22237":"NJ","22244":"TD","22280":"JQ","22300":"YH","22313":"XW","22331":"YQ","22343":"YJ","22351":"PH","22395":"DC","22412":"TD","22484":"PB","22500":"PB","22534":"ZD","22549":"DH","22561":"PB","22612":"TD","22771":"KQ","22831":"HB","22841":"JG","22855":"QJ","22865":"XQ","23013":"ML","23081":"WM","23487":"SX","23558":"QJ","23561":"YW","23586":"YW","23614":"YW","23615":"SN","23631":"PB","23646":"ZS","23663":"ZT","23673":"YG","23762":"TD","23769":"ZS","23780":"QJ","23884":"QK","24055":"XH","24113":"DC","24162":"ZC","24191":"GA","24273":"QJ","24324":"NL","24377":"TD","24378":"QJ","24439":"PF","24554":"ZS","24683":"TD","24694":"WE","24733":"LK","24925":"TN","25094":"ZG","25100":"XQ","25103":"XH","25153":"PB","25170":"PB","25179":"KG","25203":"PB","25240":"ZS","25282":"FB","25303":"NA","25324":"KG","25341":"ZY","25373":"WZ","25375":"XJ","25384":"A","25457":"A","25528":"SD","25530":"SC","25552":"TD","25774":"ZC","25874":"ZC","26044":"YW","26080":"WM","26292":"PB","26333":"PB","26355":"ZY","26366":"CZ","26397":"ZC","26399":"QJ","26415":"ZS","26451":"SB","26526":"ZC","26552":"JG","26561":"TD","26588":"JG","26597":"CZ","26629":"ZS","26638":"YL","26646":"XQ","26653":"KG","26657":"XJ","26727":"HG","26894":"ZC","26937":"ZS","26946":"ZC","26999":"KJ","27099":"KJ","27449":"YQ","27481":"XS","27542":"ZS","27663":"ZS","27748":"TS","27784":"SC","27788":"ZD","27795":"TD","27812":"O","27850":"PB","27852":"MB","27895":"SL","27898":"PL","27973":"QJ","27981":"KH","27986":"HX","27994":"XJ","28044":"YC","28065":"WG","28177":"SM","28267":"QJ","28291":"KH","28337":"ZQ","28463":"TL","28548":"DC","28601":"TD","28689":"PB","28805":"JG","28820":"QG","28846":"PB","28952":"TD","28975":"ZC","29100":"A","29325":"QJ","29575":"SL","29602":"FB","30010":"TD","30044":"CX","30058":"PF","30091":"YSP","30111":"YN","30229":"XJ","30427":"SC","30465":"SX","30631":"YQ","30655":"QJ","30684":"QJG","30707":"SD","30729":"XH","30796":"LG","30917":"PB","31074":"NM","31085":"JZ","31109":"SC","31181":"ZC","31192":"MLB","31293":"JQ","31400":"YX","31584":"YJ","31896":"ZN","31909":"ZY","31995":"XJ","32321":"PF","32327":"ZY","32418":"HG","32420":"XQ","32421":"HG","32438":"LG","32473":"GJ","32488":"TD","32521":"QJ","32527":"PB","32562":"ZSQ","32564":"JZ","32735":"ZD","32793":"PB","33071":"PF","33098":"XL","33100":"YA","33152":"PB","33261":"CX","33324":"BP","33333":"TD","33406":"YA","33426":"WM","33432":"PB","33445":"JG","33486":"ZN","33493":"TS","33507":"QJ","33540":"QJ","33544":"ZC","33564":"XQ","33617":"YT","33632":"QJ","33636":"XH","33637":"YX","33694":"WG","33705":"PF","33728":"YW","33882":"SR","34067":"WM","34074":"YW","34121":"QJ","34255":"ZC","34259":"XL","34425":"JH","34430":"XH","34485":"KH","34503":"YS","34532":"HG","34552":"XS","34558":"YE","34593":"ZL","34660":"YQ","34892":"XH","34928":"SC","34999":"QJ","35048":"PB","35059":"SC","35098":"ZC","35203":"TQ","35265":"JX","35299":"JX","35782":"SZ","35828":"YS","35830":"E","35843":"TD","35895":"YG","35977":"MH","36158":"JG","36228":"QJ","36426":"XQ","36466":"DC","36710":"JC","36711":"ZYG","36767":"PB","36866":"SK","36951":"YW","37034":"YX","37063":"XH","37218":"ZC","37325":"ZC","38063":"PB","38079":"TD","38085":"QY","38107":"DC","38116":"TD","38123":"YD","38224":"HG","38241":"XTC","38271":"ZC","38415":"YE","38426":"KH","38461":"YD","38463":"AE","38466":"PB","38477":"XJ","38518":"YT","38551":"WK","38585":"ZC","38704":"XS","38739":"LJ","38761":"GJ","38808":"SQ","39048":"JG","39049":"XJ","39052":"HG","39076":"CZ","39271":"XT","39534":"TD","39552":"TD","39584":"PB","39647":"SB","39730":"LG","39748":"TPB","40109":"ZQ","40479":"ND","40516":"HG","40536":"HG","40583":"QJ","40765":"YQ","40784":"QJ","40840":"YK","40863":"QJG"};
PY.indexOf=pyIndexOf;
function pyIndexOf(_3,_4){
if(!_3||!_4){
return -1;
}
_3=_3.toUpperCase();
_4=_4.toUpperCase();
var _5=_4.charAt(0);
var _6=_3.length-_4.length;
if(_6<0){
return -1;
}
for(var i=0;i<=_6;i++){
if(isMatch(_3.charAt(i),_5)){
if(i<=_6){
var j=i+1;
var _9=j+_4.length-1;
for(var k=1;j<_9;k++,j++){
if(!isMatch(_3.charAt(j),_4.charAt(k))){
break;
}
}
if(j==_9){
return i;
}
}
}
}
return -1;
}
function isMatch(_b,_c){
if(_b==_c){
return true;
}
var _d=false;
var _e=new String(_b).charCodeAt(0);
if((_e>=19968)&&(_e<=40869)){
_d=true;
}
if(_d){
return (_2[_e]||(_1.charAt(_e-19968))||"").indexOf(_c)>-1;
}
return false;
}
})();

function CM$LoadFolder(_1){
new CM$Folder(_1).exec();
}
function CM$Folder(_2){
this.fid=_2;
}
var CM$MailListType=Object.extend(Object.extend({},CM$AbstractList.prototype),{focus:function(_3){
CM$readLetterInIndex(this.getModuleName(),_3);
}});
Object.extend(Object.extend(CM$Folder.prototype,CM$MailListType),{getModuleName:function(){
return fGetModuleByFid(this.fid);
},getTotal:function(){
return CM.MBOX.getFolderItem(this.fid).stats.messageCount;
}});
CM$Folder.prototype.exec=function(){
try{
var _4=this.getModuleName();
var _5=MM[_4];
if(!CM[_4]||!_5||!_5.load){
if(_4!=""){
CM[_4]=this;
}
MM.createModule(_4);
}
_5.nPageStart=0;
_5.sOrderby="date";
_5.boDesc=true;
this.loadPage();
}
catch(e){
fDebug("CM$Folder#exec",e);
}
};
CM$Folder.prototype.loadPage=function(_6){
var _7=this.getModuleName();
var _8=MM[_7];
_8.clear();
var _9={fid:this.fid,order:_8.sOrderby,desc:_8.boDesc,start:_8.nPageStart,limit:this.getWindowSize()};
new CMXClient().simpleCall("mbox:listMessages",_9,CM$InsertMails.bind(null,_7,_6));
};
function CM$InsertMails(_a,_b,_c){
if("unRead"!=_a){
var _d=_c.length;
var _e=MM[_a];
if(_d<CM[_a].getWindowSize()){
if(CM[_a].getTotal()!=(_e.nPageStart+_d)){
MBOX_reload();
}
}else{
if(CM[_a].getTotal()<(_e.nPageStart+_d)){
MBOX_reload();
}
}
}
try{
MM[_a].dg.System.setData([]);
MM[_a].dg.refresh();
for(var i=0;i<_c.length;++i){
try{
CM$InsertMail(i,_c[i],_a);
}
catch(exp){
fDebug("CM$InsertMail",exp);
}
}
CM$readLetterInIndex(_a,_b);
initGotoPageFAL(_a);
}
catch(e){
fDebug("CM$Folder#getListCall("+_b+")()",e);
}
}
function CM$Mail(_10,_11,_12){
this.orientedModuleName=_10;
this.fid=fGetFidByModuleName(_10);
this.mid=_11;
this.urls=[];
this.disk=[];
this.readUrl="f:CMXMail.loadEMail('"+this.mid+"','"+_10+"');";
this.firstTimeLoad=true;
var _13=CM[_10].getCurPage();
var _14=CM[_10].getTotal();
var _15=CM[_10].getPageCount();
var _16=CM[_10].getWindowSize();
if(_12==0&&_13==0){
this.urls["pre"]="";
}else{
if(_12==0){
this.urls["pre"]="p:"+(_13-1);
}else{
this.urls["pre"]="i:"+(_12-1);
}
}
if(_12+MM[_10].nPageStart>=_14-1){
this.urls["next"]="";
}else{
if(_12>=_16-1){
this.urls["next"]="p:"+(_13+1);
}else{
this.urls["next"]="i:"+(_12+1);
}
}
}
CM$Mail.prototype.getMail=function(){
return this;
};
CM$Mail.prototype.getFolder=function(){
return this.getMail().orientedModuleName;
};
CM$Mail.prototype.getFolderId=function(){
return this.getMail().fid;
};
CM$Mail.prototype.getMid=function(){
return this.getMail().mid;
};
CM$Mail.prototype.getMimeInfo=function(){
return this.mimeInfo;
};
CM$Mail.prototype.setMimeInfo=function(_17){
if(this.getMimeInfo()){
_17.attachments=this.getMimeInfo().attachments;
}
this._setMimeInfo(_17);
};
CM$Mail.prototype._setMimeInfo=function(_18){
return this.mimeInfo=_18;
};
CM$Mail.prototype.exec=function(){
if(this.getMimeInfo()){
this.doRead();
}else{
this.read();
}
};
CM$Mail.prototype.read=function(_19){
var obj=this;
var _1b=false;
var _1c=obj.firstTimeLoad;
if(!obj.nested){
var dg=MM[GE.currentFolder].dg;
var _1e=dg.System.getData();
var mid=obj.mid.replace(/%0A.+/,"");
for(var i=0;i<_1e.length;i++){
var a=_1e[i];
var _22=CC.getMidByUrl(a[7]);
if(_22==mid){
_1b=(a[1]==5);
break;
}
}
}
var req=obj.getRequest({markRead:_1b,autoName:true,mode:"html"});
if(obj.encoding){
req.encoding=obj.encoding;
}
if(_1c&&(obj.getFolderId()==5||obj.getFolderId()==6)){
obj.filterImages=true;
}
obj.firstTimeLoad=false;
if(typeof obj.filterImages=="boolean"){
req.filterImages=obj.filterImages;
}
new CMXClient().simpleCall("mbox:readMessage",req,function(_24){
obj.setMimeInfo(_24);
obj.doRead(_19);
if(_1b&&_24.requestReadReceipt&&obj.orientedModuleName!="draft"){
switch(CM.User.attrs.op_readreceipt){
default:
case 0:
fOpenSendMDNDialog(obj);
break;
case 1:
break;
case 2:
obj.doSendMDN();
break;
}
}else{
}
});
};
CM$Mail.prototype.doSendMDN=function(){
new CMXClient().simpleCall("mbox:sendMDN",{id:this.mid});
};
CM$Mail.prototype.doRead=function(_25){
var obj=this;
var ids=[];
var _28=this.getMimeInfo();
obj.subject=_28.subject.escapeHTML();
var _29=["from","to","cc","bcc"];
for(var i=0;i<_29.length;i++){
if(_28[_29[i]]){
obj[_29[i]]=_28[_29[i]].join(",").escapeHTML();
}else{
obj[_29[i]]="";
}
}
obj.date=_28.sentDate;
var mid=obj.getMid();
obj.attach=[];
if(_28.attachments){
for(var i=0;i<_28.attachments.length;++i){
var att=_28.attachments[i];
var t={};
var _2e=att.contentType?att.contentType.toLowerCase():"";
t.name=(att.filename||"no name").escapeHTML();
t.down=CMXClient.getURL("mbox:getMessageData",{mid:mid,part:att.id,mode:"download"});
obj.attach[i]=t;
ids[i]=att.id;
}
}
obj.packAllAtta=CMXClient.getURL("mbox:packMessage",{mid:mid,part:ids,mode:"zip"});
var _2f=new EmailAddress(_28.from[0]);
obj.urls["addaddr"]=[_2f.getAddress(),_2f.getPersonal()];
if(_25&&_25.indexOf("letter")==0){
GE.isLetterDbClick=true;
GE.readOperating=true;
MM["read"].operateRead=GE.laterRequestModule;
}
try{
CM["read"]=obj;
MM.createModule("read");
MM["folder"].changeMailStatusByMid(mid,"readed");
}
catch(e){
fDebug("onepageread",e);
}
};
CM$Mail.prototype.getHTML=function(){
var _30=this.getMimeInfo();
if(_30.html){
return _30.html.content;
}else{
if(_30.text){
return "<pre style='word-wrap:break-word;' wrap=soft>"+_30.text.content.htmlencode()+"</pre>";
}else{
return "";
}
}
};
CM$Mail.prototype.isHTML=function(){
return !!this.getMimeInfo().html;
};
CM$Mail.prototype.getTEXT=function(){
var _31=this.getMimeInfo();
if(_31.text&&_31.text.content!=undefined){
return _31.text.content;
}else{
if(_31.html){
return this.getHTML().unescapeHTML();
}
}
};
CM$Mail.prototype.readHTML=function(_32){
var doc=_32.contentWindow.document;
doc.close();
doc.writeln("<base target=\"_blank\">");
doc.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\""+CC.getURL("jscss/readmail.css")+"\" charset=\"ISO-8859-1\">");
doc.writeln(this.getHTML());
doc.writeln("<script type=\"text/javascript\">"+"for (var i = 0, a; a = document.links[i]; i++) {a.target = \"_blank\"}"+"</script>");
doc.close();
doc.onmousedown=function(){
$win().fHideMenu();
DG.HTML.onBlurHTMLObject();
};
};
CM$Mail.prototype.readHeaderRaw=function(){
var obj=this;
if(obj.getMimeInfo().headerRaw==null){
var arg=obj.getRequest({attrIds:"headerRaw"});
new CMXClient().simpleCall("mbox:readMessage",arg,function(_36){
obj.getMimeInfo().headerRaw=_36.headerRaw;
obj.readHeaderRaw();
});
}else{
new UI.Dialog({title:gLang.read.toolbar["more_viewhead"],body:"<textarea style=\"width: 500px; height: 400px; overflow:auto; border:none; padding:4px 0 0 4px;\" wrap=\"off\" readonly>"+obj.getMimeInfo().headerRaw.htmlencode()+"</textarea>",button:"OK"});
}
};
CM$Mail.prototype.readMimeSource=function(){
var url=this.getCGIURL("mbox:getMessageData",{mode:"text"});
new UI.Dialog({title:gLang.read.toolbar["more_viewsrc"],body:"<iframe style=\"width: 500px; height: 400px; border:none;\" border=\"0\" frameborder=\"0\" src="+url+"></iframe>",button:"OK"});
};
CM$Mail.prototype.download=function(){
var url=this.getCGIURL("mbox:getMessageData",{mode:"download"});
fURLReffer(url,"read");
};
CM$Mail.prototype.getRequest=function(_39){
if(this.part){
return Object.extend({id:this.getMid(),part:this.part.id},_39);
}else{
return Object.extend({id:this.getMid()},_39);
}
};
CM$Mail.prototype.getCGIURL=function(_3a,_3b){
return CMXClient.getURL(_3a,this.getCGI(_3b));
};
CM$Mail.prototype.getCGI=function(_3c){
if(this.part){
return Object.extend({mid:this.getMid(),part:this.part.id},_3c);
}else{
return Object.extend({mid:this.getMid()},_3c);
}
};
CM$Mail.prototype.getPart=function(_3d){
return new CM$MailPart(this,_3d);
};
function CM$MailPart(_3e,_3f){
this.parent=_3e;
this.info=_3e.getMimeInfo().attachments[_3f];
}
CM$MailPart.prototype.getType=function(){
return this.info.contentType.toLowerCase();
};
CM$MailPart.prototype.isImage=function(){
var _40=this.getType();
if(_40.startsWith("image")){
return true;
}
if(_40&&_40!="application/octet-stream"){
return false;
}
if(!this.info.filename){
return false;
}
var ext=this.info.filename.getSuffix(".").toLowerCase();
return ext=="gif"||ext=="giff"||ext=="jpg"||ext=="jpeg"||ext=="bmp"||ext=="png"||ext=="tif"||ext=="tiff";
};
CM$MailPart.prototype.isNested=function(){
return (this.getType()=="message/rfc822")&&this.info.content!==undefined;
};
CM$MailPart.prototype.readNested=function(){
GE.isLetterDbClick=true;
new CM$NestedMail(this).read();
};
function CM$NestedMail(_42){
this.mail=_42.parent.getMail();
this.part=_42.info;
this.urls={pre:"",next:""};
}
Object.extend(CM$NestedMail.prototype,CM$Mail.prototype);
CM$NestedMail.prototype.nested=true;
CM$NestedMail.prototype.getMail=function(){
return this.mail;
};
CM$NestedMail.prototype.getMimeInfo=function(){
return this.part.content;
};
CM$NestedMail.prototype._setMimeInfo=function(_43){
return this.part.content=_43;
};
function CMXMail(){
}
CMXMail.loadEMail=function(_44,_45){
var a=MM[_45].dg.System.data;
if(a==null){
return;
}
var _47=-1;
for(var i=0;i<a.length;++i){
if(a[i][9]==_44){
_47=i;
break;
}
}
new CM$Mail(_45,_44,_47).exec();
};
CMXMail.changeMailStatus=function(_49,_4a){
var dg=MM[GE.currentFolder].dg;
var _4c=dg.HTML.getSelectTargetArray();
var req={ids:_4c.pluck("chkValue"),attrs:{}};
if(_49=="toggleread"){
_49="setnew";
_4a=5;
var _4e=dg.System.getData();
var _4f=_4c.pluck("index");
for(var i=0;i<_4f.length;++i){
var x=_4e.length-_4f[i]-1;
if(dg.getDataSpec(_4e[x]).isNew){
_49="setreaded";
_4a=6;
break;
}
}
}
if(_49=="setnew"){
if(!req.attrs.flags){
req.attrs.flags={};
}
req.attrs.flags.read=false;
}else{
if(_49=="setreaded"){
if(!req.attrs.flags){
req.attrs.flags={};
}
req.attrs.flags.read=true;
}else{
if(_49=="slow"){
req.attrs.priority=5;
}else{
if(_49=="normal"){
req.attrs.priority=3;
_4a=8;
}else{
if(_49=="mer"){
req.attrs.priority=1;
}
}
}
}
}
new CMXClient().simpleCall("mbox:updateMessageInfos",req,function(){
MM["folder"].changeMailStatus(_4a);
});
};
CMXMail.beginForwardEmail=function(_52,_53,_54){
var _55={ids:_52.split(/[,;]/),mode:_53};
var _56=(_53=="transmit");
if(_56){
_55.attrs={bcc:_54};
}
new CMXClient().simpleCall("mbox:forwardMessages",_55,function(_57){
if(_56){
UI.alert(gLang.read.msg["msg_forward_result"].replace("%",_54.join(", ")));
}else{
CM.setComposeInfo(_57);
}
});
};
CMXMail.beginReplyEmail=function(mid,_59){
var req={id:mid,toAll:_59,attrs:{subject:"",content:""}};
new CMXClient().simpleCall("mbox:replyMessage",req,function(_5b){
CM.setComposeInfo(_5b);
});
};
CMXMail.beginSendAgainEmail=function(mid,_5d){
var req={id:mid};
if(_5d>=0){
req={id:mid,partId:parseInt(_5d)};
}
new CMXClient().simpleCall("mbox:editMessage",req,function(_5f){
CM.setComposeInfo(_5f);
});
};
CMXMail.moveMail=function(_60,_61,_62,_63,_64){
var _65=[];
var _66=0;
if(_63){
_65[_65.length]=_63;
}else{
var _67=_60.moduleName;
var dg=MM[_67].dg;
var _69=dg.HTML.getSelectTargetArray();
if(_69.length==0){
return false;
}
for(var i=0;i<_69.length;i++){
_65[_65.length]=_69[i].chkValue;
if(_69[i].status==5){
_66++;
}
}
_63=_65.join(",");
}
var req={ids:_65,attrs:{fid:parseInt(_61,10)}};
if(_64!=undefined){
req["reportType"]=_64?"spam":"notspam";
}
new CMXClient().simpleCall("mbox:updateMessageInfos",req,function(){
if(_62=="fromletter"){
MM[GE.currentFolder].removeLetters(_62,_63,_61);
if(!CM.isDeleteMoveNext()){
MM.getModule(GE.currentFolder);
GE.readOperating=false;
GE.isLetterDbClick=false;
}
MM[_60.moduleName].load=false;
if(UI.Tab.exist(_60.moduleName)){
UI.Tab.close(_60.moduleName);
}
}else{
for(var _6c in UI.Tab.tabs){
if(_6c.indexOf("letter")>-1){
for(var i=0;i<_65.length;i++){
if(_65[i]==CM["letter"][_6c].mid){
UI.Tab.close(_6c);
}
}
}
}
_60.removeLetters(_62,_63,_61);
}
MBOX_reload();
});
};
CMXMail.deleteMail=function(_6e,_6f,_70){
var _71=[];
if(_70){
_71[_71.length]=_70;
}else{
var _72=_6e.moduleName;
var dg=MM[_72].dg;
var _74=dg.HTML.getSelectTargetArray();
if(_74.length==0){
return false;
}
for(var i=0;i<_74.length;i++){
_71[_71.length]=_74[i].chkValue;
}
_70=_71.join(",");
}
var _76={Module:_6e,sType:_6f,strMID:_70};
var req={ids:_71};
new CMXClient().simpleCall("mbox:deleteMessages",req,function(){
if(_76.sType=="fromletter"){
MM[GE.currentFolder].removeLetters(_76.sType,_76.strMID);
if(!CM.isDeleteMoveNext()){
MM.getModule(GE.currentFolder);
GE.readOperating=false;
GE.isLetterDbClick=false;
}
MM[_76.Module.moduleName].load=false;
if(UI.Tab.exist(_76.Module.moduleName)){
UI.Tab.close(_76.Module.moduleName);
}
}else{
for(var _78 in UI.Tab.tabs){
if(_78.indexOf("letter")>-1){
for(var i=0;i<_71.length;i++){
if(_71[i]==CM["letter"][_78].mid){
UI.Tab.close(_78);
}
}
}
}
_76.Module.removeLetters(_76.sType,_76.strMID);
MBOX_reload();
}
});
};
CMXMail.selectPreMail=function(_7a){
var _7b=_7a.urls["pre"];
var _7c=_7a.orientedModuleName;
if(_7b.substr(0,2)=="i:"){
var _7d=parseInt(_7b.substr(2),10);
CM$readLetterInIndex(_7c,_7d);
}else{
if(_7b.substr(0,2)=="p:"){
CM[_7c].relativePage(-1,-1);
}
}
};
CMXMail.selectNextMail=function(_7e){
var _7f=_7e.urls["next"];
var _80=_7e.orientedModuleName;
if(_7f.substr(0,2)=="i:"){
var _81=parseInt(_7f.substr(2),10);
CM$readLetterInIndex(_80,_81);
}else{
if(_7f.substr(0,2)=="p:"){
CM[_80].relativePage(1,0);
}
}
};
CMXMail.selectForwardUserList=function(mod){
var _83=gLang.read.msg["qry_ForwardAddress"];
var _84="<div style='margin:20px;'><nobr>"+_83+" <br><br><input size=60 name='to' autocomplete='off'/>"+"</nobr></div>";
new UI.Dialog({title:gLang.compose.msg["msg_transmit"],body:_84,init:function(div){
var _86=new AutoAddress();
var aa=new AutoAddress();
_86.create(GE.address,div.getElementsByTagName("input")[0],999);
},action:function(div){
var _89=div.getElementsByTagName("input")[0].value;
if(_89.trim()==""){
UI.alert(gLang.compose.msg["msg_nullTransmitRcpt"]);
return false;
}
if(_89&&_89!=""&&MM["compose"].sendCheck({bcc:_89})){
var _8a=_89?_89.split(/[,;]/):[];
var bcc=new Array();
var j=0;
var _8d=false;
for(i=0;i<_8a.length;i++){
if(_8a[i].trim()!=""){
var _8e=EmailAddress.parseSingleEmail(_8a[i]);
if(EmailAddress.checkAddress(_8e)){
bcc[j]=_8e;
j++;
}else{
_8d=true;
break;
}
}
}
if(_8d){
UI.alert(gLang.compose.msg["msg_invalidTransmitRcpt"]);
return false;
}
var _8f=CM.User.cos.pref_smtp_max_num_rcpts;
if(j>_8f){
UI.alert(gLang.compose.msg["msg_exceed_repts"].replace("${number}",_8f));
return false;
}
CMXMail.beginForwardEmail(mod.data.mid,"transmit",bcc);
}
}});
};
function CM$readLetterInIndex(_90,_91){
if(_91!=null){
var _92=MM[_90];
var _93=_92.dg.System.getData();
if(_91<0||_91>=_93.length){
_91=_93.length-1;
}
_92.dg.HTML.setLastSelectFocus(_91);
if(_92.dg.HTML.getSelectTarget()&&_92.dg.HTML.getSelectTarget().readUrl){
fLoadLetter(_92.dg.HTML.getSelectTarget().readUrl.htmldecode(),_90);
}else{
_92.div.innerHTML=MM[_90].getHtml();
_92.init();
}
}
}
var arrayPopColor=["#FFFFFF","#00FFFF","#FF00FF","#FFFF00","#0000FF","#FF0000","#00FF00","#000000"];
function CM$InsertMail(pos,_95,_96){
var _97="chk-"+pos+"_"+_95.from;
var _98=_95.id;
var _99=arrayPopColor[_95.backgroundColor%arrayPopColor.length];
var _9a;
if(!_95.flags.read){
_9a=5;
}else{
if(_95.flags.draft){
_9a=0;
}else{
if(_95.flags.scheduleDelivery){
_9a=1;
}else{
if(_95.flags.replied&&_95.flags.forwarded){
_9a=2;
}else{
if(_95.flags.replied){
_9a=3;
}else{
if(_95.flags.forwarded){
_9a=4;
}else{
_9a=6;
}
}
}
}
}
}
var fid=fGetFidByModuleName(_96);
var _9c=_95.from;
if(fid==2||fid==3){
_9c=_95.to;
}
var _9d="f:CMXMail.loadEMail('"+_95.id+"','"+_96+"');";
var _9e=[_95.flags.attached,_9a,fFormatEmails(_9c),_95.subject.escapeHTML(),datetimeAuto(_95.sentDate),sizeAuto(_95.size,"#,##0"),gLang.date.formatLongDate(_95.sentDate),_9d,null,_98,_97,_95.antiVirusStatus,fullMailName(_9c)];
_9e.priority=_95.priority;
_9e.backgroundColor=_95.backgroundColor;
MM[_96].dg.setDG();
MM[_96].dg.System.setDataOBO(_9e);
}
function fFormatEmails(_9f){
if(typeof _9f=="string"){
_9f=EmailAddress.parse(_9f);
}else{
_9f=_9f||[];
}
var _a0="";
for(var i=0;i<_9f.length;i++){
var _a2=_9f[i];
if(typeof _a2=="string"){
_a2=new EmailAddress(_a2);
}
if(GE.UID==_a2.getAddress()){
_a2="<span class=fgsp>"+gLang.read.mailfromme+"</span>";
}else{
if(_a2.getPersonal()){
_a2=fReplaceQuot(_a2.getPersonal().htmlencode());
}else{
var _a3=fReplaceQuot(_a2.getAddress().htmlencode());
if(_a3&&(_a3.indexOf("@")>-1)){
_a2=_a3.substring(0,_a3.indexOf("@")).trim();
}else{
_a2="";
}
}
}
if(i>0&&_a2){
_a0+=", ";
}
_a0+=_a2;
}
return _a0?_a0:(_9f?_9f:gLang.read.none);
}
function fFormatPriority(_a4){
if(_a4==null){
_a4=3;
}
if(_a4<3){
return gLang.read.page.priority_label[0];
}
if(_a4>3){
return gLang.read.page.priority_label[2];
}
return gLang.read.page.priority_label[1];
}
function fullMailName(_a5){
if(typeof _a5=="string"){
_a5=EmailAddress.parse(_a5);
}else{
_a5=_a5||[];
}
var _a6="";
for(var i=0;i<_a5.length;i++){
var _a8=_a5[i];
if(typeof _a8=="string"){
_a8=new EmailAddress(_a8);
}
_a8=fReplaceQuot(_a8.toString());
if(i>0&&_a8){
_a6+=", ";
}
_a6+=_a8;
}
return _a6;
}

CM.searchByKeyword=function(_1){
CM.searchByCondition({field:"subject",operator:"contains",operand:_1,ignoreCase:true});
};
CM.searchByCondition=function(){
var h=new CM$Search();
h.setCondictions($A(arguments));
h.exec();
};
function CM$Search(){
this.fid=0;
this.req={windowSize:this.getWindowSize(),limit:500};
if(this.req.windowSize<0){
this.req.windowSize=this.req.limit;
}
}
Object.extend(Object.extend(CM$Search.prototype,CM$MailListType),{getModuleName:function(){
return "unRead";
},getTotal:function(){
return this.searchResult.length;
}});
CM$Search.prototype.setOperator=function(_3){
this.req.operator=_3;
};
CM$Search.prototype.setFolder=function(_4,_5){
if(typeof _4=="number"){
this.req.fid=_4;
}else{
this.req.fid=fGetFidByModuleName(_4);
}
this.req.recursive=(_5==true);
};
CM$Search.prototype.setCondictions=function(_6){
this.req.condictions=_6;
};
CM$Search.prototype.exec=function(){
UI.showWaiting(gLang.search.msg_running);
var _7=this;
new CMXClient().simpleCall("mbox:searchMessages",_7.req,function(_8){
if(_8.length==0){
UI.alert(gLang.search.msg_emptyResult);
return;
}
_7.searchResult=_8;
var _9="unRead";
MM[_9].nPageStart=0;
MM[_9].sOrderby="date";
MM[_9].boDesc=true;
CM[_9]=_7;
GE.laterRequestModule=_9;
MM.createModule(_9);
if(!$("lnk"+_9)){
gApps.mbox.treeView.render();
}
fChangeTab(_9);
CM$InsertMails(_9,null,_8.slice(0,_7.req.windowSize));
});
};
CM$Search.prototype.loadPage=function(_a){
var _b=this;
var _c=this.getModuleName();
var _d=this.getWindowSize();
var _e=MM[_c].nPageStart;
var _f=CM$InsertMails.bind(null,_c,_a);
if(_e==null){
_e=MM[_c].nPageStart=0;
UI.showWaiting(gLang.search.msg_running);
MM[_c].clear();
_b.req.windowSize=_d;
_b.req.order=MM[_c].sOrderby;
_b.req.desc=MM[_c].boDesc;
new CMXClient().simpleCall("mbox:searchMessages",_b.req,function(_10){
_b.searchResult=_10;
fResetTab(_c);
if(_10.length==0){
UI.alert(gLang.search.msg_emptyResult);
}
_f(_10.slice(0,_b.req.windowSize));
});
return;
}
var end=Math.min(_e+_d,_b.searchResult.length);
var ids=[];
for(var i=_e;i<end;i++){
var pos=i-_e;
ids[pos]=_b.searchResult[i];
if(typeof ids[pos]=="object"){
ids[pos]=ids[pos].id;
}
}
UI.showWaiting(gLang.search.msg_loading);
MM[_c].clear();
var _15=new CMXClient();
_15.resultListener=function(_16){
if(_16.code=="S_PARTIAL_OK"){
var _17=_16["var"];
var all=_b.searchResult;
var _19=all.slice(0,_e);
for(var i=0;i<_17.length;++i){
if(_17[i]!=null){
_19[_19.length]=_17[i];
}
}
_19.concat(all.slice(_e+_17.length));
_b.searchResult=_19;
_b.loadPage();
return true;
}
};
_15.simpleCall("mbox:getMessageInfos",{ids:ids},_f);
};

CMXMail.checkAndLoadAddr=function(){
if(!CC.User.supportPAB){
MM["address"].load=false;
UI.alert(gLang.address.msg["msg_no_addr"]);
return false;
}
MM.execute("address");
};
CMXMail.addUserAddress=function(_1,_2,_3){
if(!CC.User.supportPAB){
MM["address"].load=false;
UI.alert(gLang.address.msg["msg_no_addr"]);
return false;
}
function editUser(oE){
var _5="address";
MM.execute(_5,function(){
if(oE.grpset==null){
var a={},b={};
if(CM[_5].Grp&&oE.groups){
CM[_5].Grp.each(function(g,_8){
a[g.id]=_8;
});
oE.groups.each(function(g,_a){
b[g]=a[g];
});
}
oE.grpset=b;
}
AddrEditDialogImp(_5,oE);
});
}
if(CM["address"]!=null&&CM["address"].Add!=null){
var _b=CM["address"].Add;
for(var i=0;i<_b.length;++i){
if(_b[i]["EMAIL;PREF"]==_1||_b[i]["FN"]==_2){
var _d="address";
editUser(_b[i]);
return;
}
}
}
var _e=["pab:getAllGroups",null,"pab:searchContacts",{"condictions":[{"field":"EMAIL;PREF","operator":"=","operand":_1,"ignoreCase":true}]}];
new CMXClient().simpleSequential(_e,function(_f){
if(CM["address"]==null){
CM["address"]={};
}
if(CM["address"].Grp==null){
CM["address"].Grp=_f[0];
}
var u=_f[_f.length-1];
if(u.length>0){
u=u[0];
}else{
u={};
}
var _11="address";
u["EMAIL;PREF"]=_1;
u["FN"]=_2;
if(u["id"]==null){
u["id"]=-1;
}
editUser(u);
});
};
function CMXWhiteBlackList(){
this.client=new CMXClient();
}
CMXWhiteBlackList.prototype.getList=function(_12,_13){
this.strUserList=_12;
this.boAddBlackList=_13;
var req={attrIds:["refuselist","safelist"]};
this.client.simpleCall("user:getAttrs",req,CMXWhiteBlackList.onFinishGetList,this);
};
CMXWhiteBlackList.onFinishGetList=function(_15,_16){
var _17="refuselist";
var obj=new Object();
if(_16.boAddBlackList){
obj.refuselist=_15.refuselist;
obj.srcSafeList=_16.strUserList;
}else{
obj.refuselist=_16.strUserList;
obj.srcSafeList=_15.safelist;
}
CM[_17]=obj;
MM.createModule(_17);
};
CMXMail.setBlackMailList=function(_19){
var _1a=new CMXWhiteBlackList();
_1a.getList(_19,true);
};
CMXMail.fillGlobalEmailList=function(Add){
if(CM["address"]!=null&&Add!=null){
var i;
var Grp=CM["address"].Grp;
var aG={};
if(Grp!=null){
for(i=0;i<Grp.length;++i){
aG[Grp[i].id]=i;
}
}
var arr=[];
for(i=0;i<Add.length;++i){
var aE=Add[i];
if(aE["EMAIL;PREF"]!=null&&aE["EMAIL;PREF"]!=""){
var uG={};
for(var j=0;j<aE.groups.length;++j){
uG[aE.groups[j]]=aG[aE.groups[j]];
}
arr[arr.length]=[aE["FN"]||"",aE["EMAIL;PREF"],uG];
}
}
GE.address=arr;
}
};
function PAB_Init(_23){
if(!_23){
CMXMail.fillGlobalEmailList([]);
return;
}
CMXMail_loadAddress(null,null,true);
}
CMXMail.loadAddress=CMXMail_loadAddress.bind(null,null,null,false);
function CMXMail_loadAddress(_24,_25,_26){
var _27=[].concat(_24||[]);
_27.push("pab:getAllGroups",null,"pab:searchContacts",_26?{returnAttrs:["FN","EMAIL;PREF","groups"]}:{order:[{"field":"FN","desc":false}]});
var _28=new CMXClient();
_28.resultListener=function(_29){
if("FA_EMAIL_EXISTS"==_29.code){
UI.alert(gLang.address.msg["msg_address_existerr"]);
return true;
}
return false;
};
_28.simpleSequential(_27,function(_2a){
var _2b=_2a[_2a.length-2];
var _2c=_2a[_2a.length-1];
var obj=CM["address"]||[];
obj.Grp=_2b;
if(!_26){
obj.Add=_2c;
}
CM["address"]=obj;
CMXMail.fillGlobalEmailList(_2c);
if(!_26){
MM.createModule("address");
}
if(_25){
_25();
}
});
}
CMXMail.submitGroup=function(_2e,_2f,_30,_31,_32){
function genNewGID(){
return "udef_"+(new Date()).formatPack();
}
var req=[];
var Grp=CM["address"].Grp;
var Add=CM["address"].Add;
var _36=(_2e==-1)?genNewGID():Grp[_2e].id;
var _37=[];
var i;
if(_2e==-1){
Grp[Grp.length]={id:_36,name:_2f};
req[req.length]="pab:updateAllGroups";
req[req.length]={"groups":Grp};
}else{
if(Grp[_2e].name!=_2f){
Grp[_2e].name=_2f;
req[req.length]="pab:updateAllGroups";
req[req.length]={"groups":Grp};
}
}
for(i=0;i<_30.length;++i){
var aE=Add[_30[i]];
if(aE.grpset[_36]==null){
var _3a=aE.groups;
_3a[_3a.length]=_36;
_37[_37.length]={id:aE.id,groups:_3a};
}
}
for(i=0;i<_31.length;++i){
var aE=Add[_31[i]];
var idx=aE.grpset[_36];
if(idx!=null){
var _3a=aE.groups;
if(idx<_3a.length-1){
_3a[idx]=_3a[_3a.length-1];
}
_3a.length=_3a.length-1;
_37[_37.length]={id:aE.id,groups:_3a};
}
}
if(_37.length>0){
req[req.length]="pab:updateContacts";
req[req.length]={"items":_37};
}
CMXMail_loadAddress(req,_32?_32.bind(null,_36):null);
};
CMXMail.deleteGroup=function(_3c){
var req=[];
var Grp=CM["address"].Grp;
var Add=CM["address"].Add;
var _40=[];
var _41=[];
var i;
for(i=0;i<Add.length;++i){
var aE=Add[i];
var idx=aE.grpset[_3c];
if(idx!=null){
var _45=aE.groups;
if(idx<_45.length-1){
_45[idx]=_45[_45.length-1];
}
_45.length=_45.length-1;
_40[_40.length]={id:aE.id,groups:_45};
}
}
if(_40.length>0){
req[req.length]="pab:updateContacts";
req[req.length]={"items":_40};
}
for(i=0;i<Grp.length;++i){
if(Grp[i].id!=_3c&&!Grp[i].reserve){
_41[_41.length]={id:Grp[i].id,name:Grp[i].name};
}
}
req[req.length]="pab:updateAllGroups";
req[req.length]={"groups":_41};
CMXMail_loadAddress(req);
};
CMXMail.editAddressUser=function(_46){
var Add=CM["address"].Add;
if(Add!=null){
for(var i=0;i<Add.length;++i){
if(Add[i].id==_46){
var _49="address";
CM[_49]=Add[i];
MM.execute(_49);
return;
}
}
}
var req={"condictions":[{"field":"id","operator":"=","operand":_46}]};
new CMXClient().simpleCall("pab:searchContacts",req,function(u){
var _4c="address";
if(u.length>0){
u=u[0];
}
CM[_4c]=u;
MM.execute(_4c);
});
};
CMXMail.submitAddress=function(obj){
var req=[(obj.id==-1?"pab:createContacts":"pab:updateContacts"),{items:[obj]}];
CMXMail_loadAddress(req);
};
CMXMail.deleteAddressUsers=function(_4f){
var req=["pab:deleteContacts",{"ids":_4f}];
CMXMail_loadAddress(req);
};
CMXMail.searchAddress=function(_51){
new CMXClient().simpleCall("pab:searchContacts",_51,function(_52){
if(_52==null||_52.length==0){
UI.alert(gLang.search.msg_emptyResult);
}else{
MM["address"].displaySearchResult(_52);
}
});
};
CMXMail.onFinishImportAddress=function(obj){
var _54=String.format(gLang.xport.msg.msg_importresult,obj.prevcnt,obj.existcnt,obj.replacedcnt,obj.addedcnt);
UI.alert(_54);
MM["address"].load=false;
GE.laterRequestModule="";
MM.execute("address");
};

CMXMail.onFinishLoadOrgAddress=function(_1,_2){
var _3="orgaddr";
var _4=CM[_3]||{};
var _5={Tree:_4.Tree,List:_4.List,Srch:_4.Srch,UserData:{}};
fOrgAddressInitGrp(_5,$$A(_1));
CM[_3]=_5;
if(_2){
_2(_1);
}else{
MM.createModule(_3);
}
};
CMXMail.checkAndLoadOrgAddr=function(){
if(!CC.User.supportOAB){
MM["orgaddr"].load=false;
UI.alert(gLang.address.msg["msg_no_orgaddr"]);
return false;
}
MM.execute("orgaddr");
};
CMXMail.loadOrgAddress=function(_6){
new CMXClient().simpleCall("oab:getDirectories",null,function(_7){
CMXMail.onFinishLoadOrgAddress(_7,_6);
});
};
CMXMail.loadOrgUserListInGroup=function(_8,_9){
new CMXClient().simpleCall("oab:list",{dn:_8,returnAttrs:{email:"",true_name:""}},function(_a){
var _b="orgaddr";
if(CM[_b].GrpData[_8]==null){
CM[_b].GrpData[_8]={};
}
CM[_b].GrpData[_8].users=_a;
_9(_a);
});
};
CMXMail.loadOrgUserDetail=function(_c,_d){
var _e=_c.join(",");
var _f={"@type":"","@list":"","@ou":"","true_name":"","email":"","gender":"","mobile_number":"","home_phone":"","company_phone":"","fax_number":"","address":"","zipcode":"","city":"","province":""};
new CMXClient().simpleCall("oab:get",{list:_e,returnAttrs:_f},function(_10){
var _11="orgaddr";
var _12=CM[_11].UserData;
var _13=CM[_11].GrpData;
for(var i=0;i<_10.length;++i){
if(_13&&_10[i]["@ou"]){
_10[i]["@ou"]=_13[_10[i]["@ou"]].fullname;
}
_12[_c[i]]=_10[i];
}
_d();
});
};
CMXMail.exportUserToAddress=function(_15,_16,_17){
var req=[];
if(_17!=null){
var Grp=CM["address"].Grp;
function genNewGID(){
return "orgudef_"+(new Date()).formatPack();
}
_16=genNewGID();
Grp[Grp.length]={id:_16,name:_17};
req[req.length]="pab:updateAllGroups";
req[req.length]={"groups":Grp};
}
req[req.length]="oab:exportToPAB";
req[req.length]={"list":_15,grp:(_16==null?"":_16),returnSummary:true};
var _1a=new CMXClient();
_1a.simpleSequential(req,function(_1b){
var _1c=_1a.result["var"];
var _1d=_1c[req.length/2-1]["summary"];
MM["address"].load=false;
UI.alert(gLang.address.msg["msg_import_from_org_ok"].replace("%",_1d.added).replace("$",_1d.updated).replace("*",_1d.ignored));
});
};
CMXMail.searchOrgAddress=function(_1e){
_1e.returnAttrs=["email","true_name"];
_1e.limit=_1e.windowSize=_1e.limit||500;
new CMXClient().simpleCall("oab:search",_1e,function(_1f){
if(_1f==null||_1f.length==0){
UI.alert(gLang.search.msg_emptyResult);
}else{
var _20="orgaddr";
var gid=MM["orgaddr"].searchGroup;
var _22=CM[_20].List;
CM[_20].Tree.setActive(gid);
CM[_20].Srch=_1f;
CM[_20].GrpData[gid].users=_1f;
_22.setData(_1f);
_22.displayData();
}
});
};
CMXMail.searchOrgAddressList=function(_23,_24,_25){
var _26={keyword:_23,limit:_25};
new CMXClient().simpleCall("oab:autoMatch",_26,function(_27){
_24(_27);
});
};

function start(){
fStartCoremail();
function fStartCoremail(){
var _1=[];
for(var _2 in CM.User){
if(typeof CM.User[_2]=="string"&&_2!="display"){
_1.add(_2);
}
}
for(var _2 in CM.User.cos){
_1.add(_2);
}
var _3=[];
for(var _2 in CM.User.attrs){
_3.add(_2);
}
var _4=["user:getAttrs",{attrIds:_1},"user:getAttrs",{attrIds:_3},"mbox:getAllFolders",{stats:true},"org:getAttrs",{},"user:getAliasWithSeed",{}];
new CMXClient().simpleSequential(_4,function(_5){
User_Init(_5[0],_5[1],_5[4]);
MBOX_Init(_5[2]);
CM.OrgInfo=_5[3];
fBeginUI();
if(CM.User.cos["perm_webmail_pop_agent"]){
new CMXClient().simpleCall("user:getPOPAccounts",null,function(_6){
CM.pop3=_6;
});
}
});
function fBeginUI(){
MM.execute("welcome",function(){
if($("oLoad")){
Element.remove("oLoad");
}
Element.show("dvHide1","dvHide3","dvRightBottom");
var _7=$("imgLogo");
adjustLogo(_7,202,42);
$win().mainInit();
GE_Init();
if(CM.MBOX.getUsedSize()>=CM.MBOX.getQuotaSize()){
UI.alert(gLang.GLOBAL.msg_overquota);
}else{
if(CM.MBOX.getUsedSize()>=CM.MBOX.getQuotaSize()*0.9){
UI.alert(gLang.GLOBAL.msg_willquota);
}
}
PAB_Init(CC.User.supportPAB);
});
function adjustLogo(_8,_9,_a){
var _b=new Image();
_b.src=_8.src;
if(_b.width>0&&_b.height>0){
if(_b.width/_b.height>=_9/_a){
if(_b.width>_9){
_8.width=_9;
_8.height=(_b.height*_9)/_b.width;
}else{
_8.width=_b.width;
_8.height=_b.height;
}
}else{
if(_b.height>_a){
_8.height=_a;
_8.width=(_b.width*_a)/_b.height;
}else{
_8.width=_b.width;
_8.height=_b.height;
}
}
}
}
}
}
}
CM.logout=function(){
fLeaveCheck(function(){
fSetNeedCheckBeforeLeave(false);
parent.location=CMXClient.getPageURL("/logout.jsp");
});
};

